Constructor
new L3D.ObjectTransform()
Properties
If not null, this matrix will be for the parent transformation matrix instead of calculating it.
The euler angle orientation of the transform.
The local space matrix of the transform. If a customMatrix has been set, it will be returned.
Parent of this ObjectTransform in its transformation hierarchy.
The worl matrix of the parent transform.
The local space position of the transform.
The quaternion orientation of the transform.
The order to apply euler angle rotations.
The local space scale of the transform.
The world space matrix of the transform.
The world space position of the transform.
Methods
configure(o)
Configure the transform with the given settings.
o |
Object |
getWorldForward(out) → Vector3
Get the world space forward vector of the transform.
out |
Vector3 | Optional storage for the output. |
getWorldMatrix(out) → Matrix4
Get the local to world space matrix of the transform.
out |
Matrix4 | Optional storage for the output. |
getWorldPosition(out) → Vector3
Get the world space position of the transform.
out |
Vector3 | Optional storage for the output. |
getWorldRight(out) → Vector3
Get the world space right vector of the transform.
out |
Vector3 | Optional storage for the output. |
getWorldRotation(out) → Quaternion
Get the world space orientation of the transform.
out |
Quaternion | Optional storage for the output. |
getWorldToLocalMatrix(out) → Matrix4
Get the world to local space matrix for the transform.
out |
Matrix4 | Optional storage for the output. |
getWorldUp(out) → Vector3
Get the world space up vector of the transform.
out |
Vector3 | Optional storage for the output. |
lookAt(position, target, up, worldSpace)
Orients the transform to look from one position to another.
position |
Vector3 | ||
target |
Vector3 | ||
up |
Vector3 | ||
worldSpace |
bool |
false
|
If true, position and target are in world space. |
onDestroy()
Called when the object is deleted.
reset()
Reset the transform to its default state.
rotate(axis, angle, worldSpace)
Rotate the transform by the angle around an axis.
axis |
Vector3 | |
angle |
number | The angle to rotate, in degrees |
worldSpace |
bool | If the axis is in world space or local space |
rotateQuaternion(q)
Rotate the transform by the given quaternion.
q |
Quaternion |
serialize()
Serialize the transform to a JSON structure.
setDirty()
Dirty the local and world matrices so they will be recomputed the next time they are requested.
setLocalDirty()
Marks the local matrix as dirty. This will also mark all of its dependents world matrices as dirty.
setWorldDirty(onlySelf)
Marks the world matrix as dirty. This will also mark all of its dependents world matrices as dirty, if onlySelf is not true.
onlySelf |
bool |
update(force)
Recompute the local and world matrices of the transform, if necessary.
force |
bool |
worldVectorToLocal(v, out) → Vector3
Transform the world space vector to the transforms local space.
v |
Vector3 | The vector to transform. |
out |
Vector3 | Optional storage for the output. |