struct Rotation

robot_2Generated
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 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 in degrees.
AnglesReturns this rotation as pitch, yaw, roll angles.
PitchReturns the pitch of this rotation.
YawReturns the yaw of this rotation.
RollReturns the roll of this rotation.
LerpToLinearly interpolates this rotation towards a target.
SlerpToSpherically interpolates this rotation towards a target.
ClampClamps the rotation to a maximum angle.
RotateAroundAxisRotates around a specified axis by a given angle.
ClosestAxisFinds the closest axis to a given normal.
AlmostEqualChecks if two rotations are almost equal 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.
ForwardThe forward direction of this rotation.
BackwardThe backward direction of this rotation.
RightThe right direction of this rotation.
LeftThe left direction of this rotation.
UpThe upward direction of this rotation.
DownThe downward direction of this rotation.
InverseReturns the inverse of this rotation.
NormalNormalizes the rotation.
ConjugateReturns the conjugate of this rotation.