Go to the source code of this file.
|
| struct | Vector3 |
| | Three-component vector, padded to a PlayStation 2 quadword. More...
|
|
| PrnStream & | operator<< (PrnStream &stream, const Vector3 &vector) |
| | Write a vector as (x: y: z:), adding w: before the parenthesis when the stream's mDumpLevel is kPrnModeFull.
|
| 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 | 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.
|
◆ operator<<()
Write a vector as (x: y: z:), adding w: before the parenthesis when the stream's mDumpLevel is kPrnModeFull.
- Parameters
-
| stream | The stream to write to. |
| vector | The vector. |
- Returns
- The stream.
- Ghidra address:
- NTSC-U/C: 0x00292ed8
- Ghidra address:
- PAL: 0x0029c8a0
◆ 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. |
◆ 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.