mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 20:34:58 +00:00
mat4 mul N
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user