神岛 API 文档 - ArenaPro版
    Preparing search index...

    表示一个四元数,用于游戏中的旋转计算。

    Represents a quaternion for rotation calculations in the game.

    Index

    Constructors

    • Parameters

      • w: number
      • x: number
      • y: number
      • z: number

      Returns GameQuaternion

      构造一个新的四元数实例。

      Constructs a new quaternion instance.

      四元数的w分量。

      The w component of the quaternion.

      四元数的x分量。

      The x component of the quaternion.

      四元数的y分量。

      The y component of the quaternion.

      四元数的z分量。

      The z component of the quaternion.

    Properties

    w: number

    四元数的 w 分量。

    The w component of the quaternion.

    x: number

    四元数的 x 分量。

    The x component of the quaternion.

    y: number

    四元数的 y 分量。

    The y component of the quaternion.

    z: number

    四元数的 z 分量。

    The z component of the quaternion.

    Methods

    • Parameters

      Returns number

      计算当前四元数与另一个四元数之间的角度。

      Calculates the angle between the current quaternion and another quaternion.

      另一个四元数。

      The other quaternion.

      角度结果(弧度)。

      The angle result in radians.

    • Parameters

      Returns number

      计算当前四元数与另一个四元数的点积。

      Calculates the dot product of the current quaternion with another quaternion.

      另一个四元数。

      The other quaternion.

      点积结果。

      The dot product result.

    • Parameters

      Returns boolean

      检查当前四元数是否与另一个四元数近似(误差值:0.000001)相等。

      Checks if the current quaternion is approximately equal to another quaternion (error value: 0.000001).

      另一个四元数。

      The other quaternion.

      如果相等返回true,否则返回false。

      Returns true if equal, otherwise false.

    • Parameters

      Returns { angle: number; axis: GameVector3 }

      获取四元数的轴角表示。

      Gets the axis-angle representation of the quaternion.

      另一个四元数(未使用)。

      Another quaternion (unused).

      包含旋转轴和旋转角度的对象。

      An object containing the axis and angle of rotation.

    • Returns number

      计算四元数的模长。

      Calculates the magnitude of the quaternion.

      模长结果。

      The magnitude result.

    • Parameters

      • rad: number

      Returns GameQuaternion

      绕x轴旋转四元数。

      Rotates the quaternion around the x-axis.

      旋转角度(弧度)。

      The rotation angle in radians.

      当前四元数实例。

      The current quaternion instance.

    • Parameters

      • rad: number

      Returns GameQuaternion

      绕y轴旋转四元数。

      Rotates the quaternion around the y-axis.

      旋转角度(弧度)。

      The rotation angle in radians.

      当前四元数实例。

      The current quaternion instance.

    • Parameters

      • rad: number

      Returns GameQuaternion

      绕z轴旋转四元数。

      Rotates the quaternion around the z-axis.

      旋转角度(弧度)。

      The rotation angle in radians.

      当前四元数实例。

      The current quaternion instance.

    • Parameters

      • w: number
      • x: number
      • y: number
      • z: number

      Returns GameQuaternion

      设置四元数的分量值。

      Sets the component values of the quaternion.

      四元数的w分量。

      The w component of the quaternion.

      四元数的x分量。

      The x component of the quaternion.

      四元数的y分量。

      The y component of the quaternion.

      四元数的z分量。

      The z component of the quaternion.

      当前四元数实例。

      The current quaternion instance.

    • Parameters

      Returns GameQuaternion

      使用球面线性插值计算两个四元数之间的中间四元数。

      Calculates an intermediate quaternion between two quaternions using spherical linear interpolation.

      另一个四元数。

      The other quaternion.

      插值参数,范围在0到1之间。

      The interpolation parameter, ranging from 0 to 1.

      插值结果四元数。

      The resulting interpolated quaternion.

    • Returns number

      计算四元数的模长的平方。

      Calculates the square of the magnitude of the quaternion.

      模长平方结果。

      The square of the magnitude.

    • Returns string

      将四元数转换为字符串表示。

      Converts the quaternion to a string representation.

      四元数的字符串表示。

      The string representation of the quaternion.

    • Parameters

      Returns GameQuaternion

      从轴角表示转换到四元数表示。

      Converts from axis-angle representation to quaternion representation.

      旋转轴。

      The axis of rotation.

      旋转角度(弧度)。

      The angle of rotation in radians.

      对应轴角表示的四元数。

      The quaternion corresponding to the axis-angle representation.

    • Parameters

      • x: number
      • y: number
      • z: number

      Returns GameQuaternion

      从欧拉角转换到四元数。

      Converts from Euler angles to quaternion.

      绕x轴的旋转角度。

      The rotation angle around the x-axis.

      绕y轴的旋转角度。

      The rotation angle around the y-axis.

      绕z轴的旋转角度。

      The rotation angle around the z-axis.

      对应欧拉角的四元数。

      The quaternion corresponding to the Euler angles.