Transform3
Transform3 represents a 3D transform combining translation, non-uniform scaling, and Euler-based rotation. It lazily builds a Matrix4 suitable for use as a world transform in scene graphs and rendering code.
Properties
touched bool
Dirty flag indicating the cached matrix needs to be recomputed.
bool touched {true};Functions
Returns the 4×4 transform matrix.
Recomputes the underlying matrix if any component has changed since the last call, then returns the cached Matrix4.
Matrix4 Transform3::Get();LookAt() void
Sets the rotation such that the object looks at a target point.
Computes an orientation that looks from position toward target, using world_up to resolve roll and construct a stable basis.
void Transform3::LookAt(const Vector3& position, const Vector3& target, const Vector3& world_up);| Parameter | Description |
|---|---|
| position | Object position. |
| target | Target point to look at. |
| world_up | World up direction. |
Rotate() void
Applies an additional rotation around a principal axis.
Only the canonical axes Vector3::Right, Vector3::Up, and Vector3::Forward are supported.
void Transform3::Rotate(const Vector3& axis, float angle);| Parameter | Description |
|---|---|
| axis | Rotation axis. |
| angle | Rotation angle in radians. |
Scale() void
Scales the transform.
void Transform3::Scale(const Vector3& value);| Parameter | Description |
|---|---|
| value | Scale factors to apply. |
SetPosition() void
Sets the translation component.
void Transform3::SetPosition(const Vector3& position);| Parameter | Description |
|---|---|
| position | New position. |
SetRotation() void
Sets the rotation component.
void Transform3::SetRotation(const Euler& rotation);| Parameter | Description |
|---|---|
| rotation | New Euler rotation. |
SetScale() void
Sets the scale component.
void Transform3::SetScale(const Vector3& scale);| Parameter | Description |
|---|---|
| scale | New scale factors. |