HeadlockRotationCalculator is used to calculate the offset to position an object to maintain a certain offset relative to where the user is looking.

Constructors

Properties

_axisBufferRadians: number = 0
_axisEasing: number = 0
_axisEnabled: boolean = true
_axisOffsetRadians: number = 0
_distance: number = 50
duration: number

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

  • get axisOffsetRadians(): number

    Returns number

  • set axisOffsetRadians(radians: number): void

    Parameters

    • radians: number

    Returns void

  • get distance(): number

    Returns number

  • set distance(distance: number): void

    Parameters

    • distance: number

    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
    • axisVector: vec3
    • positionVector: vec3

    Returns vec3

  • Returns the offset to move the target by based on the following vectors

    Parameters

    • axisVector: vec3

      the axis to rotate the target about

    • positionVector: vec3

      the current local position of the target relative to headlock center

    • originVector: vec3

      the vector to calculate an origin of rotation to determine counterclockwise or clockwise rotation

    • forwardVector: vec3

      the current look vector of the headlock controller

    • OptionalupVector: vec3

    Returns vec3

  • Returns boolean

MMNEPVFCICPMFPCPTTAAATR