struct Angles

book_4_sparkGenerated
code_blocksInput

Description

Euler angles. Unlike a Rotation, Euler angles can represent multiple revolutions (rotations) around an axis, but suffer from issues like gimbal lock and lack of a defined "up" vector. Use Rotation for most cases.

Members

Static Members

Member NameSummary
RandomReturns the angles of a uniformly random rotation.
ZeroAn angle constant that has all its values set to 0. Use this instead of making a static 0,0,0 object yourself.
ParseParses a string to create an Angles object.
TryParseTries to parse a string to create an Angles object.
ClampAngleClamps an angle to the range [0, 360).
NormalizeAngleNormalizes an angle to the range (-180, 180].
LerpLinearly interpolates between two angles.
AngleVectorConverts an angle to a direction vector.

Instance Members

Member NameSummary
ToRotationConverts these Euler angles to a rotation. The angles will be normalized.
AsVector3Return as a Vector3, where x = pitch etc.
IsNearlyZeroChecks if the angles are nearly zero within a specified tolerance.
WithPitchReturns a new Angles object with the specified pitch.
WithYawReturns a new Angles object with the specified yaw.
WithRollReturns a new Angles object with the specified roll.
ClampedReturns clamped version of this object, meaning the angle on each axis is transformed to range of [0,360).
LerpToLinearly interpolates this angle towards a target angle.
SnapToGridSnaps the angles to a specified grid size.

Fields

Member NameSummary
pitchThe pitch component, typically up/down.
yawThe yaw component, typically left/right.
rollThe roll component, basically rotation around the axis.

Properties

Member NameSummary
NormalReturns normalized version of this object, meaning the angle on each axis is normalized to range of (-180,180].
ForwardThe forward direction vector for this angle.