import { Matrix4 } from "./Matrix4.js";
import { Quaternion } from "./Quaternion.js";
import { Vector3 } from "./Vector3.js";
export class Transform {
    position;
    rotation;
    scale;
    constructor(position = Vector3.zero.clone(), rotation = Quaternion.identity.clone(), scale = Vector3.one.clone()) {
        this.position = position;
        this.rotation = rotation;
        this.scale = scale;
    }
    static identity() {
        return new Transform();
    }
    toMatrix4() {
        return Matrix4.compose(this.position, this.rotation, this.scale);
    }
    combine(child) {
        const scaledPosition = child.position.multiply(this.scale);
        const rotatedPosition = this.rotation.rotateVector(scaledPosition);
        return new Transform(this.position.add(rotatedPosition), this.rotation.multiply(child.rotation).normalize(), this.scale.multiply(child.scale));
    }
    transformPoint(point) {
        return this.toMatrix4().transformPoint(point);
    }
}
//# sourceMappingURL=Transform.js.map