mat4 mul N

This commit is contained in:
Recep Aslantas
2016-09-11 23:41:03 +03:00
parent 6635fdd7c1
commit 92ce6ee7fb

View File

@@ -10,6 +10,7 @@
#include "cglm.h"
#include "cglm-mat-simd.h"
#include <assert.h>
#define GLM_MAT_IDENTITY_4F {1.0f, 0.0f, 0.0f, 0.0f, \
0.0f, 1.0f, 0.0f, 0.0f, \
@@ -64,4 +65,21 @@ glm_mat_mul4(mat4 m1, mat4 m2, mat4 dest) {
}
}
CGLM_INLINE
void
glm_mat_mul4N(mat4 * __restrict matrices[], int len, mat4 dest) {
int i;
assert(len > 1 && "there must be least 2 matrices to go!");
glm_mat_mul4(*matrices[0],
*matrices[1],
dest);
for (i = 2; i < len; i++)
glm_mat_mul4(dest,
*matrices[i],
dest);
}
#endif /* cglm_mat_h */