phaser - v4.0.0-rc.4
    Preparing search index...

    A quaternion.

    Index

    Constructors

    • Parameters

      • Optionalx: number

        The x component. Default 0.

      • Optionaly: number

        The y component. Default 0.

      • Optionalz: number

        The z component. Default 0.

      • Optionalw: number

        The w component. Default 1.

      Returns Quaternion

    Properties

    onChangeCallback: Function

    This callback is invoked, if set, each time a value in this quaternion is changed. The callback is passed one argument, a reference to this quaternion.

    w: number

    The w component of this Quaternion.

    x: number

    The x component of this Quaternion.

    y: number

    The y component of this Quaternion.

    z: number

    The z component of this Quaternion.

    Methods

    • Calculate the length of this Quaternion squared.

      Returns number

    • Set the components of this Quaternion and optionally call the onChangeCallback.

      Parameters

      • Optionalx: number | object

        The x component, or an object containing x, y, z, and w components. Default 0.

      • Optionaly: number

        The y component. Default 0.

      • Optionalz: number

        The z component. Default 0.

      • Optionalw: number

        The w component. Default 0.

      • Optionalupdate: boolean

        Call the onChangeCallback? Default true.

      Returns Quaternion

    • Set this Quaternion from the given Euler, based on Euler order.

      Parameters

      • euler: Euler

        The Euler to convert from.

      • Optionalupdate: boolean

        Run the onChangeCallback? Default true.

      Returns Quaternion