struct Rotation

book_4_sparkGenerated
code_blocksInput

Description

The Rotation struct represents a Quaternion rotation in s&box. It can be interpreted as a direction unit vector (x, y, z) with a rotation around this direction vector (w), representing the up direction. Unlike Angles, it cannot store multiple revolutions around an axis.

Members

Static Members

Member NameSummary
FromAxisCreates a rotation from an axis and angle in degrees.
FromCreates a rotation from pitch, yaw, and roll angles.
LookAtCreates a rotation that looks in the specified forward direction.
DifferenceCalculates the difference between two rotations.
LerpLinearly interpolates between two rotations.
SlerpSpherically interpolates between two rotations.
SmoothDampSmoothly dampens a rotation towards a target.
FromToRotationCreates a rotation that rotates from one direction to another.
ParseParses a string to create a rotation.
TryParseTries to parse a string to create a rotation.
RandomReturns a uniformly random rotation.
IdentityA rotation that represents no rotation.

Instance Members

Member NameSummary
DistanceCalculates the distance to another rotation.
AngleReturns the turn length of this rotation from identity in degrees.
AnglesReturns this rotation as pitch, yaw, roll angles.
PitchReturns this rotation's pitch.
YawReturns this rotation's yaw.
RollReturns this rotation's roll.
LerpToInterpolates this rotation towards a target rotation.
SlerpToSpherically interpolates this rotation towards a target rotation.
ClampClamps this rotation towards another rotation by a maximum angle.
RotateAroundAxisRotates this rotation around a specified axis by a given angle.
ClosestAxisFinds the closest axis to a given normal.
AlmostEqualChecks if this rotation is almost equal to another within a delta.
xThe X component of this rotation.
yThe Y component of this rotation.
zThe Z component of this rotation.
wThe W component of this rotation (rotation around the normal defined by X, Y, Z components).
ForwardThe forwards direction of this rotation.
BackwardThe backwards direction of this rotation.
RightThe right hand direction of this rotation.
LeftThe left hand direction of this rotation.
UpThe upwards direction of this rotation.
DownThe downwards direction of this rotation.
InverseReturns the inverse of this rotation.
NormalNormalizes this rotation.
ConjugateReturns the conjugate of this rotation, negating the X, Y, and Z components.