[util] Clarify the comment for AngleVectors

I found it rather confusing that the matrices were all backwards, and
the existing comments about being "horizontal" didn't really help all
that much. After spending some time with maxima, I was able to verify
that the comments were indeed correct, just transposed (horizontal),
with the final composition reversed to reflect that transposition.
This commit is contained in:
Bill Currie 2023-08-13 17:33:46 +09:00
parent f3ca2f158b
commit e00a871824

View file

@ -513,9 +513,8 @@ BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs, const plane_t *p)
forward is local X and right is local Y (left handed), or forward is local forward is local X and right is local Y (left handed), or forward is local
Y and right is local X (right handed). Y and right is local X (right handed).
NOTE: these matrices have forward, left and up vectors horizontal rather NOTE: the matrices in this coment are transposed so the vector names
than vertical and are thus the inverse of the matrices to produce the can be written naturally.
actual rotation.
pitch = pitch =
cp 0 -sp cp 0 -sp
@ -532,6 +531,8 @@ BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs, const plane_t *p)
0 cr sr 0 cr sr
0 -sr cr 0 -sr cr
// NOTE: as these matrices are transposed, this is the reverse of the
// actual operation
final = roll * (pitch * yaw) final = roll * (pitch * yaw)
final = final =
[forward] [forward]