import { Mat4 } from '../../math/mat4'; import { Vec3 } from '../../math/vec3'; import { Component } from '../component'; /** * 3D Transform Component, defining the "physical" attributes of an Entity as well as transformation methods, enabling presence in 3D space */ export declare class Transform extends Component { readonly initialPosition: Vec3; readonly initialScale: Vec3; readonly initialAngles: Vec3; readonly velocity: Vec3; /** Maintained position */ readonly position: Vec3; /** Maintained 'forward' Axis */ readonly forward: Vec3; /** Maintained 'up' Axis */ readonly up: Vec3; /** Maintained 'right' Axis */ readonly right: Vec3; /** Maintained scale factor */ readonly scale: Vec3; /** Maintained rotation angles (radians) */ readonly angles: Vec3; /** * Constructor. Take the initial position, scale, angles and velocity of the Entity and provide the name 'Transform' to the parent class * * @param initialPosition the 3D position of the Entity * @param initialScale the 3D scale of the Entity * @param initialAngle the initial 3D rotations of the Entity * @param velocity the initial 3D velocity of the Entity */ constructor(initialPosition?: Vec3, initialScale?: Vec3, initialAngles?: Vec3, velocity?: Vec3); /** * Move along the right axis by a given amount (relative to self) * * @param amount the amount to move by */ moveRight(amount: number): void; /** * Move along the up axis by a given amount (relative to self) * * @param amount the amount to move by */ moveUp(amount: number): void; /** * Move along the forward axis by a given amount (relative to self) * * @param amount the amount to move by */ moveForward(amount: number): void; /** * Move along all three axes by a given 3D vector (relative to self) * * @param amounts the 3D vector to move by */ move(amounts: Vec3): void; /** * Move by a given translation vector (relative to world axes) * * @param translate the translation vector */ translate(translate: Vec3): void; /** * Rotate by a given angle (radians) around the X axis; pitch * * @param angle the angle to rotate by */ rotateX(angle: number): void; /** * Rotate by a given angle (radians) around the Y axis; yaw * * @param angle the angle to rotate by */ rotateY(angle: number): void; /** * Rotate by a given angle (radians) around the Z axis; roll * * @param angle the angle to rotate by */ rotateZ(angle: number): void; /** * Rotate around all three axes by 3 given angles (radians) * * @param angles the X, Y and Z angles to rotate by */ rotate(angles: Vec3): void; /** * Scale by a given factor (relative to current scale) * * @param factor the 3D factor to scale by */ scaleBy(factor: Vec3): void; /** * Scale to a given absolute factor * * @param factor the 3D factor to scale to */ scaleTo(factor: Vec3): void; /** * Reset all transformations back to their initial values */ reset(): void; /** * Compute the composite Transform Matrix from the maintained translation, scaling and rotation * * @returns the Transform matrix */ compute(): Mat4; /** * Retrieve a Mutable cast of the Transform instance; enables internal-only mutation of translation, rotation and scale * * @returns the typecasted Mutable Transform instance */ private get mutable(); }