Back to class index
Quat[Class Summary]
x
y
z
w
identity[static][const]
nan[static][const]
ctor (+7 overloads)
WorldX()[const]
WorldY()[const]
WorldZ()[const]
Axis()[const]
Angle()[const]
Dot(rhs)[const]
LengthSq()[const]
Length()[const]
Normalize()
Normalized()[const]
IsNormalized(epsilon)[const]
IsInvertible(epsilon)[const]
IsFinite()[const]
Equals(rhs,epsilon)[const]
ptr() (+1 overload)
Inverse()
Inverted()[const]
InverseAndNormalize()
Conjugate()
Conjugated()[const]
Transform(x,y,z)[const] (+2 overloads)
Lerp(target,t)[const]
Slerp(target,t)[const]
AngleBetween(target)[const]
AxisFromTo(target)[const]
ToAxisAngle(...)[const]
SetFromAxisAngle(...)
Set(matrix) (+3 overloads)
ToEulerXYX()[const]
ToFloat3x3()[const]
ToFloat3x4()[const]
ToFloat4x4()[const]
operator*(rhs)[const] (+1 overload)
operator/(rhs)[const]
Mul(rhs)[const] (+3 overloads)
Lerp(source,target,t)[static]
Slerp(source,target,t)[static]
LookAt(...)[static]
RotateX(angleRadians)[static]
RotateY(angleRadians)[static]
RotateZ(angleRadians)[static]
RotateAxisAngle(...)[static]
RotateFromTo(...)[static] (+1 overload)
FromEuler***(x2,y,x)[static]
RandomRotation(lcg)[static]
FromString(str)[static]

Quat::ToEulerXYX

Syntax

float3 Quat::ToEulerXYX() const; [1 line of code]
float3 Quat::ToEulerXZX() const; [1 lines of code]
float3 Quat::ToEulerYXY() const; [1 lines of code]
float3 Quat::ToEulerYZY() const; [1 lines of code]
float3 Quat::ToEulerZXZ() const; [1 lines of code]
float3 Quat::ToEulerZYZ() const; [1 lines of code]
float3 Quat::ToEulerXYZ() const; [1 lines of code]
float3 Quat::ToEulerXZY() const; [1 lines of code]
float3 Quat::ToEulerYXZ() const; [1 lines of code]
float3 Quat::ToEulerYZX() const; [1 lines of code]
float3 Quat::ToEulerZXY() const; [1 lines of code]
float3 Quat::ToEulerZYX() const; [1 lines of code]

Extracts the rotation part of this quaternion into Euler rotation angles (in radians).

Note
It is better to think about the returned float3 as an array of three floats, and not as a triple of xyz, because e.g. the .y component returned by ToEulerYXZ() does not return the amount of rotation about the y axis, but contains the amount of rotation in the second axis, in this case the x axis.

Return Value

A float3 which specifies the rotation of this quaternion in radian Euler angles. The function ToEulerABC returns a float3 where the first element ([0], or x) specifies the rotation about the axis A (not necessarily the X axis!), [1] or y specifies the rotation about the B axis (not necessarily the Y axis!) and [2] or z specifies the rotation about the C axis (not necessarily the Z axis!). The order of rotations follows the M*v convention, meaning that ToEulerXYZ returns the Euler angles for rotating a vector v in the order X * (Y * (Z * v))), i.e. right-to-left.

Performance

float3 Quat::ToEulerXYX() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerXZX() const

0.164μsecs/call ≈ 6.09M calls/second ≈ 101.5k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerYXY() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerYZY() const

0.172μsecs/call ≈ 5.8M calls/second ≈ 96.66k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerZXZ() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerZYZ() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerXYZ() const

0.164μsecs/call ≈ 6.09M calls/second ≈ 101.5k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerXZY() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerYXZ() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerYZX() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerZXY() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 Quat::ToEulerZYX() const

0.16μsecs/call ≈ 6.25M calls/second ≈ 104.1k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

Work in progress:

Todo: in float3 Quat::ToEulerXYX() const:
the following could be heavily optimized. Don't route through float3x3 conversion.

Leave a Comment

Name:
Comments:
Captcha:captcha image Type in the black symbols:
Back to class index