PokéRogue
    Preparing search index...

    Represents a set of Euler angles (rotation around X, Y, and Z axes) used for 3D rotations. Euler angles describe orientation using three successive rotations around the coordinate axes. The order property defines which axes and in what sequence the rotations are applied (e.g., 'XYZ' applies rotation around X first, then Y, then Z).

    Index
    • Parameters

      • Optionalx: number

        The rotation around the X axis, in radians. Default 0.

      • Optionaly: number

        The rotation around the Y axis, in radians. Default 0.

      • Optionalz: number

        The rotation around the Z axis, in radians. Default 0.

      • Optionalorder: string

        The order in which rotations are applied. One of 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', or 'XZY'. Default 'XYZ'.

      Returns Euler

    order: string

    The rotation order used when applying Euler angles. Determines the sequence in which rotations around the X, Y, and Z axes are applied. Must be one of: 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', or 'XZY'.

    Setting this property will invoke the onChangeCallback, if one has been set.

    x: number

    The rotation around the X axis, in radians.

    Setting this property will invoke the onChangeCallback, if one has been set.

    y: number

    The rotation around the Y axis, in radians.

    Setting this property will invoke the onChangeCallback, if one has been set.

    z: number

    The rotation around the Z axis, in radians.

    Setting this property will invoke the onChangeCallback, if one has been set.

    • Copies the X, Y, Z, and order properties from another Euler instance into this one.

      Parameters

      • euler: Euler

        The Euler instance to copy from.

      Returns Euler

      This Euler instance.

    • Sets the X, Y, Z, and order components of this Euler angle simultaneously.

      After updating all internal values, onChangeCallback is invoked with this Euler instance as the argument.

      Parameters

      • x: number

        The rotation around the X axis, in radians.

      • y: number

        The rotation around the Y axis, in radians.

      • z: number

        The rotation around the Z axis, in radians.

      • Optionalorder: string

        The rotation order. Defaults to the current order if not specified.

      Returns Euler

      This Euler instance.

    • Sets the Euler angles from a Quaternion, using the specified rotation order.

      The quaternion is first converted to a rotation matrix internally, then setFromRotationMatrix is called to derive the Euler angles. This avoids gimbal lock issues by working through the matrix representation.

      Parameters

      • quaternion: Quaternion

        The quaternion to derive Euler angles from.

      • Optionalorder: string

        The rotation order to use. Defaults to the current order if not specified.

      • Optionalupdate: boolean

        Whether to invoke onChangeCallback after setting the values. Default false.

      Returns Euler

      This Euler instance.

    • Sets the Euler angles from the upper-left 3x3 rotation portion of a 4x4 Matrix4, using the specified rotation order.

      The matrix is assumed to be a pure rotation matrix (un-scaled). Each supported rotation order has its own decomposition formula. If the update parameter is true, onChangeCallback is invoked after the values are set.

      Parameters

      • matrix: Matrix4

        The rotation matrix to derive Euler angles from. Must be a pure (un-scaled) rotation matrix.

      • Optionalorder: string

        The rotation order to use. Defaults to the current order if not specified.

      • Optionalupdate: boolean

        Whether to invoke onChangeCallback after setting the values. Default false.

      Returns Euler

      This Euler instance.