struct Angles

in global

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.


public float pitch

The pitch component, typically up/down.

public float yaw

The yaw component, typically left/right.

public float roll

The roll component, basically rotation around the axis.

public Angles( float pitch, float yaw, float roll )

Initializes the angles object with given components.

  • pitch The Pitch component.
  • yaw The Yaw component.
  • roll The roll component.

public Angles( Angles other )

Copies values of given angles object.

public Angles( Vector3 vector )

Where x, y and z represent the pitch, yaw and roll respectively.

public Angles( float all = 0 )

Initializes the angles object with all components set to given value.

public static Angles Zero

An angle constant that has all its values set to 0. Use this instead of making a static 0,0,0 object yourself.

public static Angles Random { get; }

Returns the angles of a uniformly random rotation.

public bool IsNearlyZero( double tolerance = 1E-06 )

Returns true if this angles object's components are all nearly zero with given tolerance.

public Angles WithPitch( float pitch )

Returns this angles object with given pitch component.

public Angles WithYaw( float yaw )

Returns this angles object with given yaw component.

public Angles WithRoll( float roll )

Returns this angles object with given roll component.

public static Angles Parse( string str )

Given a string, try to convert this into an angles object. The format is "p,y,r".

public static Angles Parse( string str, IFormatProvider provider )

🤡 Doc inheritance is not yet supported.

No summary.

public static bool TryParse( string str, ref Angles result )

🤡 Doc inheritance is not yet supported.

No summary.

public static bool TryParse( string str, IFormatProvider provider, ref Angles result )

🤡 Doc inheritance is not yet supported.

No summary.

public Angles Normal { get; }

Returns normalized version of this object, meaning the angle on each axis is normalized to range of (-180,180].

public static float ClampAngle( float v )

Clamps the angle to range of [0, 360)

public static float NormalizeAngle( float v )

Normalizes the angle to range of (-180, 180]

public static Angles Lerp( ref Angles source, ref Angles target, float frac )

Performs linear interpolation on the two given angle objects.

  • source Angle A
  • target Angle B
  • frac Fraction in range [0,1] between the 2 angle objects to use for interpolation.

public Angles LerpTo( Angles target, float frac )

Performs linear interpolation on the two given angle objects.

  • target Angle B
  • frac Fraction in range [0,1] between the 2 angle objects to use for interpolation.

public static Vector3 AngleVector( Angles ang )

Converts an angle to a forward vector.

public Vector3 Forward { get; set; }

The forward direction vector for this angle.

public Angles SnapToGrid( float gridSize, bool sx = True, bool sy = True, bool sz = True )

Snap to grid

public static Angles op_Multiply( Angles c1, float c2 )

😔 No documentation found.

public static Angles op_Division( Angles c1, float c2 )

😔 No documentation found.

public static bool op_Equality( ref Angles left, ref Angles right )

😔 No documentation found.

public static bool op_Inequality( ref Angles left, ref Angles right )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public bool Equals( Angles o )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public static Angles op_Addition( Angles c1, Vector3 c2 )

😔 No documentation found.

public static Angles op_Addition( Angles c1, Angles c2 )

😔 No documentation found.

public Angles Clamped( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public Vector3 AsVector3( )

😔 No documentation found.

public static Angles op_Subtraction( Angles c1, Angles c2 )

😔 No documentation found.

public Rotation ToRotation( )

😔 No documentation found.