Isle
|
Quaternion interpolation utility for 4D transformations, supporting quaternion start/end points and spherical interpolation. More...
#include <mxquaternion.h>
Public Types | |
enum | { c_startSet = 0x01 , c_endSet = 0x02 } |
Interpolation state flags. [AI]. More... | |
Public Member Functions | |
MxQuaternionTransformer () | |
Default constructor; flags zeroed, state unset. More... | |
long | NormalizeDirection () |
Ensures shortest path interpolation by potentially flipping the end quaternion's sign. More... | |
void | SetStartEnd (Matrix4 &p_m1, Matrix4 &p_m2) |
Sets start and end quaternions by converting two matrices to quaternion form. More... | |
void | SetStart (Matrix4 &p_m) |
Sets the start quaternion from a matrix. More... | |
void | SetEnd (Matrix4 &p_m) |
Sets the end quaternion from a matrix. More... | |
void | SetStart (Vector4 &p_v) |
Sets the start quaternion from a 4D vector. More... | |
void | SetEnd (Vector4 &p_v) |
Sets the end quaternion from a 4D vector. More... | |
int | InterpolateToMatrix (Matrix4 &p_matrix, float p_f) |
Interpolates between start and end quaternions using spherical interpolation (slerp) and produces a 4x4 matrix. More... | |
void | GetQuat (Vector4 &p_startQuat, Vector4 &p_endQuat) const |
Retrieves the stored start and end quaternions as 4D vectors. More... | |
undefined4 | GetFlags () const |
Returns current flag state indicating which ends are set. More... | |
Quaternion interpolation utility for 4D transformations, supporting quaternion start/end points and spherical interpolation.
[AI]
Handles the conversion of 4x4 transformation matrices to quaternion representations, as well as interpolation (slerp) between two quaternions. Used for smooth rotation transitions in animations or transformations. Can also convert results back to matrix form. [AI]
Definition at line 14 of file mxquaternion.h.
anonymous enum |
Interpolation state flags. [AI].
Enumerator | |
---|---|
c_startSet | Start quaternion has been set. [AI]. |
c_endSet | End quaternion has been set. [AI]. |
Definition at line 17 of file mxquaternion.h.
|
inline |
|
inline |
Returns current flag state indicating which ends are set.
[AI]
Definition at line 92 of file mxquaternion.h.
Retrieves the stored start and end quaternions as 4D vectors.
[AI]
p_startQuat | Returned start quaternion. [AI] |
p_endQuat | Returned end quaternion. [AI] |
Definition at line 83 of file mxquaternion.h.
|
inline |
Interpolates between start and end quaternions using spherical interpolation (slerp) and produces a 4x4 matrix.
[AI]
p_matrix | Matrix to receive the interpolated transformation. [AI] |
p_f | Interpolation parameter between 0.0f (start) and 1.0f (end). [AI] |
|
inline |
Ensures shortest path interpolation by potentially flipping the end quaternion's sign.
[AI]
If the direction from start to end quaternion is longer than the opposite direction, the end quaternion is negated. This ensures proper spherical interpolation (prevents spinning the "long way" around the sphere). Returns 0 on success, -1 if neither start or end are set. [AI]
|
inline |
Sets the end quaternion from a matrix.
[AI]
p_m | Matrix representing the end orientation. [AI] |
|
inline |
Sets the end quaternion from a 4D vector.
[AI]
p_v | Vector representing the end quaternion (x, y, z, w). [AI] |
|
inline |
Sets the start quaternion from a matrix.
[AI]
p_m | Matrix representing the start orientation. [AI] |
|
inline |
Sets the start quaternion from a 4D vector.
[AI]
p_v | Vector representing the start quaternion (x, y, z, w). [AI] |
Sets start and end quaternions by converting two matrices to quaternion form.
[AI]
Equivalent to calling SetStart followed by SetEnd. [AI]
p_m1 | Matrix to use as start quaternion. [AI] |
p_m2 | Matrix to use as end quaternion. [AI] |