BillboardRotationCalculator is used to calculate the quaternion to rotate an object by to align with a new vector along an axis. More specifically, this calculator is used along a SceneObject's local X/Z-axes and global Y-axis. These calculators only take in vec3's as SceneObject manipulation is handled in BillboardController.

Constructors

Properties

_axisBufferRadians: number = 0
_axisEasing: number = 1
_axisEnabled: boolean = false
duration: number = 0

Accessors

  • get axisBufferRadians(): number

    Returns number

  • set axisBufferRadians(radians: number): void

    Parameters

    • radians: number

    Returns void

  • get axisEasing(): number

    Returns number

  • set axisEasing(easing: number): void

    Parameters

    • easing: number

    Returns void

  • get axisEnabled(): boolean

    Returns boolean

  • set axisEnabled(enabled: boolean): void

    Parameters

    • enabled: boolean

    Returns void

Methods

  • Returns the angle about specified axis to rotate the target to align with the camera. By projecting the forward/up vector onto planes defined by the relevant axis as the normal, we can separately calculate the angles of each axis. The separate calculations allow for each axis to have its own buffer / interpolation values. Because the user is expected to walk around freely, we use local X and Z axes for calculation, but global Y axis as the user's perception of 'up' is constant.

    Parameters

    Returns number

  • Parameters

    • angle: number

    Returns number

  • Parameters

    • rotationRadians: number
    • axisVector: vec3

    Returns quat

  • Parameters

    Returns quat

  • Used to snap the target immediately into proper rotation according to configuration.

    Parameters

    • axisVector: vec3

      the vector to rotate about

    • forwardVector: vec3

      the forward vector of the target

    • cameraVector: vec3

      the vector from camera to target

    • originVector: vec3

      the origin of rotation as a reference to ensure proper rotation

    Returns quat

    the rotation about the given axis to align the target's forward vector with the camera.

  • Returns boolean

MMNEPVFCICPMFPCPTTAAATR