The Transform3D is an entity component providing position and rotation for a 3D object. More...
Inherits Quantum.IComponent.
Public Member Functions | |
FPVector3 | InverseTransformDirection (FPVector3 direction) |
Transforms a direction from world space to local space. Rotation is expected to be normalized. More... | |
FPVector3 | InverseTransformPoint (FPVector3 position) |
Transforms a position from world space to local space. Rotation is expected to be normalized. More... | |
void | LookAt (FPVector3 position, FPVector3? up=null) |
Rotates the transform so the forward vector points at position . If up is not set, will use FPVector3.Up instead. More... | |
void | Rotate (FP xAngle, FP yAngle, FP zAngle, bool normalize=true) |
Applies a rotation of zAngle degrees around the z-axis, xAngle degrees around the x-axis, and yAngle degrees around the y-axis (in that order). More... | |
void | Rotate (FPVector3 angles, bool normalize=true) |
Applies a rotation of angles .z degrees around the z-axis, angles .x degrees around the x-axis, and angles .y degrees around the y-axis (in that order). More... | |
void | Rotate (FPVector3 axis, FP angle, bool normalize=true) |
Rotates the object around the given axis by the number of degrees defined by the given angle. More... | |
FPVector3 | TransformDirection (FPVector3 direction) |
Transforms a direction from local space to world space. Rotation is expected to be normalized. More... | |
FPVector3 | TransformPoint (FPVector3 position) |
Transforms a position from local space to world space. Rotation is expected to be normalized. More... | |
Public Attributes | |
FPVector3 | Back => -Forward |
A vector pointing to local -Z axis. More... | |
FPVector3 | Down => -Up |
A vector pointing to local -Y axis. More... | |
FPVector3 | EulerAngles => Rotation.AsEuler |
Converts rotation to Euler angles triplet. More... | |
FPVector3 | Left => -Right |
A vector pointing to local -X axis. More... | |
FPMatrix4x4 | LocalToWorldMatrix => FPMatrix4x4.TRS(Position, Rotation, FPVector3.One) |
Creates local to world transformation. Rotation is expected to be normalized. More... | |
FPMatrix4x4 | WorldToLocalMatrix => FPMatrix4x4.InverseTRS(Position, Rotation, FPVector3.One) |
Creates world to local transformation. Rotation is expected to be normalized. More... | |
Properties | |
FPVector3 | Forward [get] |
A vector pointing to local +Z axis. More... | |
FPVector3 | Right [get] |
A vector pointing to local +X axis. More... | |
FPVector3 | Up [get] |
A vector pointing to local +Y axis. More... | |
The Transform3D is an entity component providing position and rotation for a 3D object.
Transforms a direction from world space to local space. Rotation is expected to be normalized.
Transforms a direction from local space to world space. Rotation is expected to be normalized.
Transforms a position from world space to local space. Rotation is expected to be normalized.
Transforms a position from local space to world space. Rotation is expected to be normalized.
Rotates the transform so the forward vector points at position . If up is not set, will use FPVector3.Up instead.
position | |
up |
|
inline |
Applies a rotation of angles .z degrees around the z-axis, angles .x degrees around the x-axis, and angles .y degrees around the y-axis (in that order).
angles | Euler angles, in degrees. |
normalize | If the resultant quaternion should be normalized before being set to the Rotation. This prevents rounding error from accumulating and potentially rounding the quaternion magnitude towards zero over time. |
Applies a rotation of zAngle degrees around the z-axis, xAngle degrees around the x-axis, and yAngle degrees around the y-axis (in that order).
xAngle | |
yAngle | |
zAngle | |
normalize | If the resultant quaternion should be normalized before being set to the Rotation. This prevents rounding error from accumulating and potentially rounding the quaternion magnitude towards zero over time. |
Rotates the object around the given axis by the number of degrees defined by the given angle.
axis | |
angle | |
normalize | If the resultant quaternion should be normalized before being set to the Rotation. This prevents rounding error from accumulating and potentially rounding the quaternion magnitude towards zero over time. |
FPVector3 Quantum.Transform3D.EulerAngles => Rotation.AsEuler |
Converts rotation to Euler angles triplet.
.
FPMatrix4x4 Quantum.Transform3D.LocalToWorldMatrix => FPMatrix4x4.TRS(Position, Rotation, FPVector3.One) |
Creates local to world transformation. Rotation is expected to be normalized.
FPMatrix4x4 Quantum.Transform3D.WorldToLocalMatrix => FPMatrix4x4.InverseTRS(Position, Rotation, FPVector3.One) |
Creates world to local transformation. Rotation is expected to be normalized.
|
get |
A vector pointing to local +X axis.
|
get |
A vector pointing to local +Y axis.
|
get |
A vector pointing to local +Z axis.