Go to the source code of this file.
|
| class | Quat |
| | Rotation quaternion, stored as the vector part followed by the scalar part. More...
|
◆ operator<<()
Write a quaternion as x: y: z: w:.
- Parameters
-
| stream | The stream to write to. |
| quat | The quaternion. |
- Returns
- The stream.
- Ghidra address:
- NTSC-U/C: 0x00292d88
- Ghidra address:
- PAL: 0x0029c750
◆ EulerAnglesToQuat()
| Quat EulerAnglesToQuat |
( |
const float * | pAngles | ) |
|
Build a rotation quaternion from three Euler angles.
The composition is the same one Rnd::MakeRotMatrix() produces from three angles. That is, the product is qz * qx * qy, with each factor a rotation about one axis by the matching component. The sines and cosines come from SinApprox().
- Parameters
-
| pAngles | The three angles in radians, ordered X, Y, and Z. |
- Returns
- The quaternion.
- Ghidra address:
- NTSC-U/C: 0x002925d8
- Ghidra address:
- PAL: 0x0029bfa0
◆ QuatSlerp()
| void QuatSlerp |
( |
const Quat & | from, |
|
|
const Quat & | to, |
|
|
Quat & | out, |
|
|
float | flT ) |
Interpolate between two rotation quaternions along the shorter arc.
A negative dot product flips the second quaternion. The interpolation therefore never takes the long way round. Both endpoint values of the parameter are special cased and copy an endpoint verbatim. Two inputs whose dot product is within 1e-5 of one fall back to a component-wise linear blend. The sines come from SinApprox().
- Parameters
-
| from | The rotation at a parameter of zero. |
| to | The rotation at a parameter of one. |
| out | Receives the interpolation. |
| flT | The interpolation parameter. |
- Ghidra address:
- NTSC-U/C: 0x00292970
- Ghidra address:
- PAL: 0x0029c338
◆ Mat33ExtractScale()
| void Mat33ExtractScale |
( |
const float * | pMat3Rows, |
|
|
float * | pScale ) |
Report the scale each basis row carries.
Each scale is the length of its row. The Z scale is negated unless the dot product of the Z row with the cross product of the X and Y rows is positive.
- Parameters
-
| pMat3Rows | The basis, three rows of four floats. |
| pScale | Receives the three scales. |
- Ghidra address:
- NTSC-U/C: 0x002924f0
- Ghidra address:
- PAL: 0x0029beb8