Hilo3d API - v2.0.0
    Preparing search index...

    Class QuaternionNotifier

    四元数,具有 onUpdate 回调

    Hierarchy (View Summary)

    Index
    className: string = 'QuaternionNotifier'

    类名

    elements: quat
    isQuaternion: boolean = true
    isQuaternionNotifier: boolean = true
    • Calculates the W component of a quat from the X, Y, and Z components. Assumes that quaternion is 1 unit in length. Any existing W component will be ignored.

      Returns this

      this

    • Calculates the conjugate of a quat If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.

      Returns this

      this

    • 从数组赋值

      Parameters

      • array: ArrayLike<number>

        数组

      • offset: number = 0

        数组偏移值

      Returns this

      this

    • Creates a quaternion from the given 3x3 rotation matrix.

      NOTE: The resultant quaternion is not normalized, so you should be sure to renormalize the quaternion yourself where necessary.

      Parameters

      Returns this

      this

    • Creates a quaternion from the given 3x3 rotation matrix.

      NOTE: The resultant quaternion is not normalized, so you should be sure to renormalize the quaternion yourself where necessary.

      Parameters

      Returns this

      this

    • Gets the rotation axis and angle for a given quaternion. If a quaternion is created with setAxisAngle, this method will return the same values as providied in the original parameter list OR functionally equivalent values. Example: The quaternion formed by axis [0, 0, 1] and angle -90 is the same as the quaternion formed by [0, 0, 1] and 270. This method favors the latter.

      Parameters

      • axis: Vector3

        Vector receiving the axis of rotation

      Returns number

      Angle, in radians, of the rotation

    • Set the components of a quat to the given values

      Parameters

      • x: number

        X component

      • y: number

        Y component

      • z: number

        Z component

      • w: number

        W component

      Returns this

      this

    • Sets the specified quaternion with values corresponding to the given axes. Each axis is a vec3 and is expected to be unit length and perpendicular to all other specified axes.

      Parameters

      • view: Vector3

        the vector representing the viewing direction

      • right: Vector3

        the vector representing the local "right" direction

      • up: Vector3

        the vector representing the local "up" direction

      Returns this

      this