mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Fix some bugs in the new matrix functions/macros.
This commit is contained in:
parent
55e53b796d
commit
ea2ae1436c
2 changed files with 3 additions and 1 deletions
|
@ -314,7 +314,7 @@ extern const vec_t *const quat_origin;
|
|||
QuatCompMult ((a) + 12, (b) + 12, (c) + 12); \
|
||||
} while (0)
|
||||
#define Mat4Zero(a) \
|
||||
memset (a, 0, sizeof (16 * sizeof a[0]))
|
||||
memset (a, 0, 16 * sizeof a[0])
|
||||
#define Mat4Identity(a) \
|
||||
do { \
|
||||
Mat4Zero (a); \
|
||||
|
|
|
@ -703,12 +703,14 @@ Mat4Transpose (const mat4_t a, mat4_t b)
|
|||
int i, j;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
b[i * 4 + i] = a[i * 4 + i]; // in case b != a
|
||||
for (j = i + 1; j < 4; j++) {
|
||||
t = a[i * 4 + j]; // in case b == a
|
||||
b[i * 4 + j] = a[j * 4 + i];
|
||||
b[j * 4 + i] = t;
|
||||
}
|
||||
}
|
||||
b[i * 4 + i] = a[i * 4 + i]; // in case b != a
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue