Up to date

This page is up to date for Godot `4.2`. If you still find outdated information, please open an issue.

# Quaternion¶

## 属性¶

 float w `1.0` float x `0.0` float y `0.0` float z `0.0`

## 构造函数¶

 Quaternion Quaternion Quaternion ( Quaternion from ) Quaternion Quaternion ( Vector3 arc_from, Vector3 arc_to ) Quaternion Quaternion ( Vector3 axis, float angle ) Quaternion Quaternion ( Basis from ) Quaternion Quaternion ( float x, float y, float z, float w )

## 方法¶

 float angle_to ( Quaternion to ) const float dot ( Quaternion with ) const Quaternion exp ( ) const Quaternion from_euler ( Vector3 euler ) static float get_angle ( ) const Vector3 get_axis ( ) const Vector3 get_euler ( int order=2 ) const Quaternion inverse ( ) const bool is_equal_approx ( Quaternion to ) const bool is_finite ( ) const bool is_normalized ( ) const float length ( ) const float length_squared ( ) const Quaternion log ( ) const Quaternion normalized ( ) const Quaternion slerp ( Quaternion to, float weight ) const Quaternion slerpni ( Quaternion to, float weight ) const Quaternion spherical_cubic_interpolate ( Quaternion b, Quaternion pre_a, Quaternion post_b, float weight ) const Quaternion spherical_cubic_interpolate_in_time ( Quaternion b, Quaternion pre_a, Quaternion post_b, float weight, float b_t, float pre_a_t, float post_b_t ) const

## 操作符¶

 bool operator != ( Quaternion right ) Quaternion operator * ( Quaternion right ) Vector3 operator * ( Vector3 right ) Quaternion operator * ( float right ) Quaternion operator * ( int right ) Quaternion operator + ( Quaternion right ) Quaternion operator - ( Quaternion right ) Quaternion operator / ( float right ) Quaternion operator / ( int right ) bool operator == ( Quaternion right ) float operator [] ( int index ) Quaternion Quaternion

## 常量¶

IDENTITY = `Quaternion(0, 0, 0, 1)`

## 属性说明¶

float w = `1.0`

float x = `0.0`

float y = `0.0`

float z = `0.0`

## 构造函数说明¶

Quaternion Quaternion ( )

Quaternion Quaternion ( Quaternion from )

Quaternion Quaternion ( Vector3 arc_from, Vector3 arc_to )

Quaternion Quaternion ( Vector3 axis, float angle )

Quaternion Quaternion ( Basis from )

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

## 方法说明¶

float angle_to ( Quaternion to ) const

float dot ( Quaternion with ) const

Quaternion exp ( ) const

Quaternion from_euler ( Vector3 euler ) static

float get_angle ( ) const

Vector3 get_axis ( ) const

Vector3 get_euler ( int order=2 ) const

Quaternion inverse ( ) const

bool is_equal_approx ( Quaternion to ) const

bool is_finite ( ) const

bool is_normalized ( ) const

float length ( ) const

float length_squared ( ) const

Quaternion log ( ) const

Quaternion normalized ( ) const

Quaternion slerp ( Quaternion to, float weight ) const

Quaternion slerpni ( Quaternion to, float weight ) const

Quaternion spherical_cubic_interpolate ( Quaternion b, Quaternion pre_a, Quaternion post_b, float weight ) const

Quaternion spherical_cubic_interpolate_in_time ( Quaternion b, Quaternion pre_a, Quaternion post_b, float weight, float b_t, float pre_a_t, float post_b_t ) const

## 操作符说明¶

bool operator != ( Quaternion right )

Quaternion operator * ( Quaternion right )

Vector3 operator * ( Vector3 right )

Quaternion operator * ( float right )

Quaternion operator * ( int right )

Quaternion operator + ( Quaternion right )

Quaternion operator - ( Quaternion right )

Quaternion operator / ( float right )

Quaternion operator / ( int right )

bool operator == ( Quaternion right )

float operator [] ( int index )

Quaternion operator unary+ ( )

Quaternion operator unary- ( )