The Transform struct is a fundamental component in s&box, encapsulating a position, rotation, and scale. It is widely used to describe the spatial properties of entities, bones, and scene objects within the engine.
The Transform struct is a fundamental component in s&box, encapsulating a position, rotation, and scale. It is widely used to describe the spatial properties of entities, bones, and scene objects within the engine.
Member Name | Summary |
---|---|
Zero | Represents a zero transform, with a scale of 1, position of Vector3.Zero and rotation of Rotation.Identity. |
Lerp | Interpolates between two transforms. |
Concat | Concatenates a parent and local transform. |
Parse | Parses a string to create a transform. |
Member Name | Summary |
---|---|
PointToLocal | Converts a world point to local space. |
NormalToLocal | Converts a world normal to local space. |
RotationToLocal | Converts a world rotation to local space. |
PointToWorld | Converts a local point to world space. |
NormalToWorld | Converts a local normal to world space. |
RotationToWorld | Converts a local rotation to world space. |
ToLocal | Converts a child transform to local space. |
ToWorld | Converts a child transform to world space. |
LerpTo | Interpolates this transform towards a target transform. |
Add | Adds a position to this transform, optionally in world space. |
WithPosition | Sets the position of this transform. |
WithRotation | Sets the rotation of this transform. |
WithScale | Sets the scale of this transform. |
RotateAround | Rotates this transform around a specified center and rotation. |
AlmostEqual | Checks if this transform is almost equal to another, within a delta. |
UniformScale | A uniform scale component. Generally, the scale is uniform, accessed via the .x component. |
Forward | Gets the forward direction of this transform. |
Backward | Gets the backward direction of this transform. |
Up | Gets the upward direction of this transform. |
Down | Gets the downward direction of this transform. |
Right | Gets the rightward direction of this transform. |
Left | Gets the leftward direction of this transform. |
IsValid | Returns true if position, scale, and rotation are valid. |
ForwardRay | Returns a ray from this transform, extending from the center along the forward direction. |
Position | Position of the transform. |
Scale | Scale of the transform. Does not scale Position or Rotation. |
Rotation | Rotation of this transform. |