Go to the source code of this file.
|
| struct | Vector3 |
| | Three-component vector, padded to a PlayStation 2 quadword. More...
|
|
| namespace | Rnd |
| | The rendering engine.
|
|
| void | Rnd::Add (const float *pA, const float *pB, float *pOut) |
| | Add two three-component vectors.
|
| void | Rnd::Subtract (const float *pA, const float *pB, float *pOut) |
| | Subtract one three-component vector from another.
|
| void | Vec3Scale (const float *pSrc, float flScale, float *pOut) |
| | Multiply a three-component vector by a scalar.
|
| void | NegateVec3 (const float *pSrc, float *pOut) |
| | Negate a three-component vector.
|
| void | Vec3Normalize (const float *pSrc, float *pOut) |
| | Scale a three-component vector to unit length.
|
| void | CrossVec3 (const float *pA, const float *pB, float *pOut) |
| | Take the cross product of two three-component vectors.
|
|
| constexpr int | kVec3PaddingFloat = 3 |
| | Index of the padding float that follows the three components of a quadword vector.
|
◆ Vec3Scale()
| void Vec3Scale |
( |
const float * | pSrc, |
|
|
float | flScale, |
|
|
float * | pOut ) |
Multiply a three-component vector by a scalar.
Writes three components and does not touch the fourth word of the destination. The source arrives in $a0, the destination in $a1, and the factor in $f12. Integer and float argument registers are allocated independently on this target. The declared position of the factor is therefore an inference from the destination-last order the other helpers here use, and the register evidence alone does not fix it.
- Parameters
-
| pSrc | The vector to scale. |
| flScale | The factor to apply. |
| pOut | Receives the product, and may alias pSrc. |
- Ghidra address:
- NTSC-U/C: 0x0024ecd0
- Ghidra address:
- PAL: 0x002640f8
◆ NegateVec3()
| void NegateVec3 |
( |
const float * | pSrc, |
|
|
float * | pOut ) |
Negate a three-component vector.
Writes three components and does not touch the fourth word of the destination.
- Parameters
-
| pSrc | The vector to negate. |
| pOut | Receives the negation, and may alias pSrc. |
- Ghidra address:
- NTSC-U/C: 0x00492458
- Ghidra address:
- PAL: 0x004d0308
◆ Vec3Normalize()
| void Vec3Normalize |
( |
const float * | pSrc, |
|
|
float * | pOut ) |
Scale a three-component vector to unit length.
The vector unit takes the reciprocal square root of the dot of the first three components with themselves, then scales those three by it. Both the load and the store move a whole quadword. The fourth word of the destination therefore receives the fourth word of the source unchanged. A zero-length input is not guarded against.
- Parameters
-
| pSrc | The vector to normalise. |
| pOut | Receives the unit vector, and may alias pSrc. |
- Ghidra address:
- NTSC-U/C: 0x00476140
- Ghidra address:
- PAL: 0x004b3db8
◆ CrossVec3()
| void CrossVec3 |
( |
const float * | pA, |
|
|
const float * | pB, |
|
|
float * | pOut ) |
|
inline |
Take the cross product of two three-component vectors.
The image has no out-of-line copy. Every caller inlines the VU0 vopmula.xyz and vopmsub.xyz pair, which writes only the three components and therefore leaves the fourth word of pA in the result.
- Parameters
-
| pA | The first vector. |
| pB | The second vector. |
| pOut | Receives pA cross pB, and may alias either input. |
◆ kVec3PaddingFloat
| int kVec3PaddingFloat = 3 |
|
constexpr |
Index of the padding float that follows the three components of a quadword vector.