|
wavelength 1.0.0
|
Classes | |
| struct | Ray |
| Line in a plane, given as a point on it and its direction. More... | |
Functions | |
| void | MakeRotMatrix (const Quat &quat, float *pMat3Rows) |
| Convert a rotation quaternion to a rotation matrix. | |
| Vector2 | Intersect (const Ray &first, const Ray &second) |
| Find where two lines in a plane cross. | |
| void | MakeRotMatrix (const float *pAngles, float *pMat3Rows) |
| Build a rotation matrix from three Euler angles. | |
| void | Scale (const float *pScale, const float *pMat3Rows, float *pOut) |
| Scale each row of a rotation matrix by one component of a vector. | |
| void | Add (const Vector2 &a, const Vector2 &b, Vector2 &out) |
| Add two two-component vectors. | |
| void | Normalize (const Vector2 &v, Vector2 &out) |
| Scale a two-component vector to unit length. | |
| float | Length (const Vector2 &v) |
| Report the length of a two-component vector. | |
| void | Add (const float *pA, const float *pB, float *pOut) |
| Add two three-component vectors. | |
| void | Subtract (const float *pA, const float *pB, float *pOut) |
| Subtract one three-component vector from another. | |
| void Rnd::MakeRotMatrix | ( | const Quat & | quat, |
| float * | pMat3Rows ) |
Convert a rotation quaternion to a rotation matrix.
The result is the transpose of the usual column-vector rotation, because this engine transforms row vectors. Only nine of the twelve words are written, and the fourth word of each row is untouched.
| quat | The rotation, treated as unit length. |
| pMat3Rows | Receives the rotation, three rows of four floats. |
Find where two lines in a plane cross.
Parallel lines report the point of the first line.
| first | The first line. |
| second | The second line. |
| void Rnd::MakeRotMatrix | ( | const float * | pAngles, |
| float * | pMat3Rows ) |
Build a rotation matrix from three Euler angles.
The product is Ry * Rx * Rz, with each factor a rotation about one axis by the matching component and every factor written for row vectors. Mat34DecomposeEulerScale() inverts the same composition and EulerAnglesToQuat() reproduces it as a quaternion. Only nine of the twelve words are written, and the fourth word of each row is untouched. The sines and cosines come from SinApprox().
| pAngles | The three angles in radians, ordered X, Y, and Z. |
| pMat3Rows | Receives the rotation, three rows of four floats. |
| void Rnd::Scale | ( | const float * | pScale, |
| const float * | pMat3Rows, | ||
| float * | pOut ) |
Scale each row of a rotation matrix by one component of a vector.
Row zero takes the first component, row one the second, and row two the third. This is how a non-uniform scale is folded into a basis. Only nine of the twelve words are written, and the fourth word of each row is untouched.
| pScale | The three scales. |
| pMat3Rows | The basis to scale, three rows of four floats. |
| pOut | Receives the scaled basis, and may alias pMat3Rows. |
Add two two-component vectors.
The destination may alias either source because both loads precede both stores. The routine reads y before x and stores y before x, with the x store in the return delay slot.
| a | The first vector. |
| b | The second vector. |
| out | Receives a plus b, and may alias either input. |
Scale a two-component vector to unit length.
The zero vector yields the zero vector rather than a division by zero.
| v | The vector. |
| out | Receives the unit vector. |
| float Rnd::Length | ( | const Vector2 & | v | ) |
Report the length of a two-component vector.
| v | The vector. |
| void Rnd::Add | ( | const float * | pA, |
| const float * | pB, | ||
| float * | pOut ) |
Add two three-component vectors.
Writes three components and does not touch the fourth word of the destination. The two inputs arrive in $a0 and $a1 and the destination in $a2.
| pA | The first vector. |
| pB | The second vector. |
| pOut | Receives pA plus pB, and may alias either input. |
| void Rnd::Subtract | ( | const float * | pA, |
| const float * | pB, | ||
| float * | pOut ) |
Subtract one three-component vector from another.
Writes three components and does not touch the fourth word of the destination. The minuend arrives in $a0, the subtrahend in $a1, and the destination in $a2.
| pA | The vector subtracted from. |
| pB | The vector to subtract. |
| pOut | Receives pA less pB, and may alias either input. |