W3cubDocs

/Godot 2.1

Quat

Category: Built-In Types

Brief Description

Quaternion.

Member Functions

Quat Quat ( float x, float y, float z, float w )
Quat Quat ( Vector3 axis, float angle )
Quat Quat ( Matrix3 from )
Quat cubic_slerp ( Quat b, Quat pre_a, Quat post_b, float t )
float dot ( Quat b )
Quat inverse ( )
float length ( )
float length_squared ( )
Quat normalized ( )
Quat slerp ( Quat b, float t )
Quat slerpni ( Quat b, float t )
Vector3 xform ( Vector3 v )

Member Variables

Description

Quaternion is a 4 dimensional vector that is used to represent 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

Quat Quat ( float x, float y, float z, float w )

Quat Quat ( Vector3 axis, float angle )

Quat Quat ( Matrix3 from )

Quat cubic_slerp ( Quat b, Quat pre_a, Quat post_b, float t )

float dot ( Quat b )

Returns the dot product between two quaternions.

Quat inverse ( )

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

float length ( )

Returns the length of the quaternion.

float length_squared ( )

Returns the length of the quaternion, squared.

Quat normalized ( )

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

Quat slerp ( Quat b, float t )

Perform a spherical-linear interpolation with another quaternion.

Quat slerpni ( Quat b, float t )

Vector3 xform ( Vector3 v )

© 2014–2017 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/2.1/classes/class_quat.html