Quat Structure |
Namespace: Godot
[SerializableAttribute] public struct Quat : IEquatable<Quat>
The Quat type exposes the following members.
Name | Description | |
---|---|---|
Quat(Basis) |
Constructs a quaternion from the given Basis.
| |
Quat(Quat) |
Constructs a quaternion from the given quaternion.
| |
Quat(Vector3) |
Constructs a quaternion that will perform a rotation specified by
Euler angles (in the YXZ convention: when decomposing,
first Z, then X, and Y last),
given in the vector format as (X angle, Y angle, Z angle).
| |
Quat(Vector3, Single) |
Constructs a quaternion that will rotate around the given axis
by the specified angle. The axis must be a normalized vector.
| |
Quat(Single, Single, Single, Single) |
Constructs a quaternion defined by the given values.
|
Name | Description | |
---|---|---|
Identity |
The identity quaternion, representing no rotation.
Equivalent to an identity Basis matrix. If a vector is transformed by
an identity quaternion, it will not change.
| |
Item |
Access quaternion components using their index.
| |
Length |
Returns the length (magnitude) of the quaternion.
| |
LengthSquared |
Returns the squared length (squared magnitude) of the quaternion.
This method runs faster than Length, so prefer it if
you need to compare quaternions or need the squared length for some formula.
|
Name | Description | |
---|---|---|
CubicSlerp |
Performs a cubic spherical interpolation between quaternions `preA`,
this vector, `b`, and `postB`, by the given amount `t`.
| |
Dot |
Returns the dot product of two quaternions.
| |
Equals(Object) | (Overrides ValueTypeEquals(Object).) | |
Equals(Quat) | ||
GetEuler |
Returns Euler angles (in the YXZ convention: when decomposing,
first Z, then X, and Y last) corresponding to the rotation
represented by the unit quaternion. Returned vector contains
the rotation angles in the format (X angle, Y angle, Z angle).
| |
GetHashCode | (Overrides ValueTypeGetHashCode.) | |
GetType | (Inherited from Object.) | |
Inverse |
Returns the inverse of the quaternion.
| |
IsEqualApprox |
Returns true if this quaternion and `other` are approximately equal, by running
IsEqualApprox(Single, Single) on each component.
| |
IsNormalized |
Returns whether the quaternion is normalized or not.
| |
Normalized |
Returns a copy of the quaternion, normalized to unit length.
| |
Set(Quat) | Obsolete. | |
Set(Single, Single, Single, Single) | Obsolete. | |
SetAxisAngle | Obsolete. | |
SetEuler | Obsolete. | |
Slerp |
Returns the result of the spherical linear interpolation between
this quaternion and `to` by amount `weight`.
Note: Both quaternions must be normalized.
| |
Slerpni |
Returns the result of the spherical linear interpolation between
this quaternion and `to` by amount `weight`, but without
checking if the rotation path is not bigger than 90 degrees.
| |
ToString | (Overrides ValueTypeToString.) | |
ToString(String) | ||
Xform |
Returns a vector transformed (multiplied) by this quaternion.
|
Name | Description | |
---|---|---|
Addition | ||
Division | ||
Equality | ||
Inequality | ||
Multiply(Single, Quat) | ||
Multiply(Quat, Quat) | ||
Multiply(Quat, Vector3) | ||
Multiply(Quat, Single) | ||
Multiply(Vector3, Quat) | ||
Subtraction | ||
UnaryNegation |
Name | Description | |
---|---|---|
w |
W component of the quaternion (real part).
Quaternion components should usually not be manipulated directly.
| |
x |
X component of the quaternion (imaginary `i` axis part).
Quaternion components should usually not be manipulated directly.
| |
y |
Y component of the quaternion (imaginary `j` axis part).
Quaternion components should usually not be manipulated directly.
| |
z |
Z component of the quaternion (imaginary `k` axis part).
Quaternion components should usually not be manipulated directly.
|