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 two transforms. |
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 transform to local space. |
ToWorld | Converts a transform to world space. |
LerpTo | Interpolates this transform towards another. |
Add | Adds a position to the transform. |
WithPosition | Sets the position of the transform. |
WithRotation | Sets the rotation of the transform. |
WithScale | Sets the scale of the transform. |
RotateAround | Rotates the transform around a specified point. |
AlmostEqual | Checks if two transforms are approximately equal. |
UniformScale | A uniform scale component. Generally, the scale is uniform, and the .x component is accessed. |
Forward | Gets the forward direction of the transform. |
Backward | Gets the backward direction of the transform. |
Up | Gets the upward direction of the transform. |
Down | Gets the downward direction of the transform. |
Right | Gets the right direction of the transform. |
Left | Gets the left direction of the transform. |
IsValid | Returns true if position, scale, and rotation are valid. |
ForwardRay | Returns a ray from this transform, going 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. |