struct Transform

robot_2Generated
code_blocksInput

Description

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.

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 a parent and local transform.
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.
LerpToInterpolates this transform towards a target transform.
AddAdds a position to this transform, optionally in world space.
WithPositionSets the position of this transform.
WithRotationSets the rotation of this transform.
WithScaleSets the scale of this transform.
RotateAroundRotates this transform around a specified center and rotation.
AlmostEqualChecks if this transform is almost equal to another, within a delta.
UniformScaleA uniform scale component. Generally, the scale is uniform, accessed via the .x component.
ForwardGets the forward direction of this transform.
BackwardGets the backward direction of this transform.
UpGets the upward direction of this transform.
DownGets the downward direction of this transform.
RightGets the rightward direction of this transform.
LeftGets the leftward direction of this transform.
IsValidReturns true if position, scale, and rotation are valid.
ForwardRayReturns a ray from this transform, extending from the center along the forward direction.
PositionPosition of the transform.
ScaleScale of the transform. Does not scale Position or Rotation.
RotationRotation of this transform.