struct Transform

book_4_sparkGenerated
code_blocksInput

Description

The Transform struct is a fundamental component in the s&box engine, encapsulating a position, rotation, and scale. It is widely used to define the spatial properties of entities, bones, and scene objects.

Members

Static Members

Member NameSummary
ZeroRepresents a zero transform, with a scale of 1, position of Vector3.Zero, and rotation of Rotation.Identity.
LerpInterpolates between two transforms.
ConcatConcatenates two transforms.
ParseParses a string to create a transform.

Instance Members

Member NameSummary
PointToLocalConverts a world point to local space.
NormalToLocalConverts a world normal to local space.
RotationToLocalConverts a world rotation to local space.
PointToWorldConverts a local point to world space.
NormalToWorldConverts a local normal to world space.
RotationToWorldConverts a local rotation to world space.
ToLocalConverts a child transform to local space.
ToWorldConverts a child transform to world space.
AddAdds a position to the transform, optionally in world space.
WithPositionSets the position of the transform.
WithRotationSets the rotation of the transform.
WithScaleSets the scale of the transform.
RotateAroundRotates the transform around a specified point.

Properties

Property NameSummary
UniformScaleA uniform scale component, typically accessed via the x component.
ForwardGets the forward direction of the transform.
BackwardGets the backward direction of the transform.
UpGets the upward direction of the transform.
DownGets the downward direction of the transform.
RightGets the rightward direction of the transform.
LeftGets the leftward direction of the transform.
IsValidIndicates if the transform's position, scale, and rotation are valid.
ForwardRayReturns a ray from the transform's center along the forward direction.

Fields

Field NameSummary
PositionPosition of the transform.
ScaleScale of the transform, not affecting position or rotation.
RotationRotation of the transform.