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 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 transform to local space.
ToWorldConverts a transform to world space.
LerpToInterpolates this transform towards another.
AddAdds a position to the transform.
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.
AlmostEqualChecks if two transforms are approximately equal.
UniformScaleA uniform scale component. Generally, the scale is uniform, and the .x component is accessed.
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 right direction of the transform.
LeftGets the left direction of the transform.
IsValidReturns true if position, scale, and rotation are valid.
ForwardRayReturns a ray from this transform, going 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.