Options
All
  • Public
  • Public/Protected
  • All
Menu

An orthogonal rotation in 3d space

Hierarchy

  • Rotator

Implements

  • Iterable<number>

Index

Constructors

constructor

  • new Rotator(roll: number, pitch: number, yaw: number): Rotator
  • Make a rotator {Roll, Pitch, Yaw} from rotation values

    Parameters

    • roll: number

      Rotation around X axis in degrees

    • pitch: number

      Rotation around Y axis in degrees

    • yaw: number

      Rotation around Z axis in degrees

    Returns Rotator

Properties

0

0: number

Index for pitch

1

1: number

Index for yaw

2

2: number

Index for roll

pitch

pitch: number

Pitch (degrees) around Y axis

roll

roll: number

Roll (degrees) around X axis

yaw

yaw: number

Yaw (degrees) around Z axis

Methods

[Symbol.iterator]

  • [Symbol.iterator](): Iterator<number>

clone

compose

  • Combine 2 rotations to give the resulting rotation of first applying this rotator, then b

    Parameters

    Returns Rotator

equals

  • equals(b: Rotator, errorTolerance: number): boolean
  • Return true if this rotator is equal to rotator b (a == b) within a specified error tolerance

    Parameters

    • b: Rotator

      Rotator to compare to

    • errorTolerance: number

      Maximum total difference

    Returns boolean

getForwardVector

getRightVector

getUpVector

multiply

  • Return rotator representing this rotation scaled by b

    Parameters

    • b: number

      Factor to multiply with

    Returns Rotator

negate

rotateVector

toString

  • toString(): string
  • Convert to a string in the form 'P= Y= R='

    Returns string

toVector

unrotateVector

Static fromAxisAngle

  • Create a rotation from an axis and and angle

    Parameters

    • axis: Vector

      The axis to rotate around

    • angle: number

      The amount of rotation in degrees

    Returns Rotator

Static interpolateTo

  • Smoothly interpolate towards a varying target rotation

    Parameters

    • current: Rotator

      Current rotation

    • target: Rotator

      Target rotation

    • deltaTime: number

      Time since last tick

    • interpSpeed: number

      Interpolation speed

    Returns Rotator

Static interpolateToConstant

  • interpolateToConstant(current: Rotator, target: Rotator, deltaTime: number, interpSpeed: number): Rotator
  • Smoothly interpolate towards a varying target rotation at a constant rate

    Parameters

    • current: Rotator

      Current rotation

    • target: Rotator

      Target rotation

    • deltaTime: number

      Time since last tick

    • interpSpeed: number

      Interpolation speed

    Returns Rotator

Static lerp

  • Linearly interpolate between a and b based on alpha

    Parameters

    • a: Rotator

      First rotation

    • b: Rotator

      Second rotation

    • alpha: number

      Result is 100% of a when alpha=0 and 100% of b when alpha=1

    • bShortestPath: boolean

    Returns Rotator