import { Euler, Object3D, Quaternion, Vector3 } from "three"; import { Identifiable } from "./identifiable"; import { Entity } from "./stage/entity"; /** * Transform is responsible for allowing positioning, rotating and scaling of * 3D objects in the Renderer. * * When assigning new values for a Transform, the values are copied */ export declare class Transform extends Identifiable { private readonly _threeObject; private readonly _owner; private readonly _children; private _parent; constructor(owner: Entity); /** * Returns the THREE.js Object backing */ get object(): Object3D; get position(): Vector3; set position(pos: Vector3); get orientation(): Quaternion; set orientation(quat: Quaternion); get rotation(): Euler; set rotation(rot: Euler); get scale(): Vector3; set scale(sca: Vector3); /** * Returns the current entity this transform is attached to */ get owner(): Entity; /** * Returns the parent Transform if any or null. * To set the parent, use Transform.add() */ get parent(): Transform | null; /** * Returns the children Transforms as an Array */ get children(): Array; /** * Detach this Transform from a previous hierarchy * @returns - true if deatched, false otherwise */ detach(): boolean; /** * Adds another transform into this transform hierarchy * @param transform - the transform to add into this hierarchy * @param preserveWorld - (optional - default: true) should the world coordinate be preserved? * @returns - this transform */ add(transform: Transform, preserveWorld?: boolean): Transform; /** * Removes the provided transform from this object hierarchy * @param transform - the transform to remove from this object hirarchy * @returns - this transform */ remove(transform: Transform): Transform; }