Type Angle

3-dimensional eulerian angles.

Methods

Add( angle ) Adds the given argument angle's component values to the given angle, modifying in-place.
Div( divisor ) Divides the given angle's component values by the given number, modifying in-place.
Forward() Returns the forward direction for the given angles.
IsZero() Returns true if the angle has all components equal to 0.
Mul( multiplier ) Multiplies the given angle's component values by the given number, modifying in-place.
Normalize() Normalises the given angle's components into the (-180, 180] range, modifying in-place.
Right() Returns the right direction for the given angles.
RotateAroundAxis( axis, amount ) Rotates the given angles around the given axis by the given amount in degrees, modifying in-place.
Set( angle ) Sets the angle's component values to equal the given angles, modifying in-place.
SetUnpacked( pitch, yaw, roll ) Sets the angle's component values, modifying in-place.
SnapTo( component, targetDegrees ) Rounds a component of the given angles to the given amount of degrees.
Sub( angle ) Subtracts the given argument angles from the given angles, modifying in-place.
ToTable() Returns the angles as an array of 3 elements.
Unpack() Returns the component values of the angle.
Up() Returns the up direction for the given angles.
Zero() Sets all component values to 0, modifying in-place..


Methods

Angle:Add( angle )
Adds the given argument angle's component values to the given angle, modifying in-place.

Environment:

Shared

Parameters:

  • (Angle) angle: The angle to add.

Return value:

    (Angle) The modified angle.
Angle:Div( divisor )
Divides the given angle's component values by the given number, modifying in-place.

Environment:

Shared

Parameters:

  • (number) divisor: The number value to divide the angle's components by.

Return value:

    (Angle) The modified angle.
Angle:Forward()
Returns the forward direction for the given angles.

Environment:

Shared
Angle:IsZero()
Returns true if the angle has all components equal to 0.

Environment:

Shared
Angle:Mul( multiplier )
Multiplies the given angle's component values by the given number, modifying in-place.

Environment:

Shared

Parameters:

  • (number) multiplier: The number value to multiply the angle's components by.

Return value:

    (Angle) The modified angle.
Angle:Normalize()
Normalises the given angle's components into the (-180, 180] range, modifying in-place.

Environment:

Shared

Return value:

    (Angle) The modified angle.
Angle:Right()
Returns the right direction for the given angles.

Environment:

Shared
Angle:RotateAroundAxis( axis, amount )
Rotates the given angles around the given axis by the given amount in degrees, modifying in-place.

Environment:

Shared

Parameters:

  • (Vector) axis: The axis vector to rotate the angles around.
  • (number) amount: The amount in degrees to rotate by.

Return value:

    (Angle) The modified angle.
Angle:Set( angle )
Sets the angle's component values to equal the given angles, modifying in-place.

Environment:

Shared

Parameters:

  • (Angle) angle: The angle to take the component values from.

Return value:

    (Angle) The modified angle.
Angle:SetUnpacked( pitch, yaw, roll )
Sets the angle's component values, modifying in-place.

Environment:

Shared

Parameters:

  • (number) pitch: The pitch to set.
  • (number) yaw: The yaw to set.
  • (number) roll: The roll to set.

Return value:

    (Angle) The modified angle.
Angle:SnapTo( component, targetDegrees )
Rounds a component of the given angles to the given amount of degrees.

Environment:

Shared

Parameters:

  • (string) component: The component to be snapped (e.g. "p", "y", "r").
  • (number) targetDegrees: The amount of degrees to round to (e.g. 90 would round to the nearest multiple of 90 degrees).

Return value:

    (Angle) The modified angle.
Angle:Sub( angle )
Subtracts the given argument angles from the given angles, modifying in-place.

Environment:

Shared

Parameters:

  • (Angle) angle: The angle to subtract.

Return value:

    (Angle) The modified angle.
Angle:ToTable()
Returns the angles as an array of 3 elements.

Environment:

Shared
Angle:Unpack()
Returns the component values of the angle.

Environment:

Shared

Return values:

  1. (number) The pitch value.
  2. (number) The yaw value.
  3. (number) The roll value.
Angle:Up()
Returns the up direction for the given angles.

Environment:

Shared
Angle:Zero()
Sets all component values to 0, modifying in-place..

Environment:

Shared

Return value:

    (Angle) The modified angle.

Valid XHTML 1.0!