class_quat - dragonsoulz/godot GitHub Wiki

Quat

####Category: Built-In Types

Brief Description

Quaternion.

Member Functions

Member Variables

Description

Quaternion is a 4 dimensional vector that is used to represet a rotation. It mainly exists to perform SLERP (spherical-linear interpolation) between to rotations obtained by a Matrix3 cheaply. Adding quaternions also cheaply adds the rotations, however quaternions need to be often normalized, or else they suffer from precision issues.

Member Function Description

dot

Returns the dot product between two quaternions.

inverse

Returns the inverse of the quaternion (applies to the inverse rotatio too).

length

Returns the length of the quaternion.

length_squared

  • float length_squared ( )

Returns the length of the quaternion, minus the square root.

normalized

  • Quat normalized ( )

Returns a copy of the quaternion, normalized to unit length.

slerp

Perform a spherical-linear interpolation with another quaternion.