diff options
| author | raysan5 <[email protected]> | 2021-03-28 22:04:04 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2021-03-28 22:04:04 +0200 |
| commit | b5aaf33058df329963c8d7825d58131bebd13647 (patch) | |
| tree | ebff241590528c4cb6e4f01ff33ff1702d178262 /src/models.c | |
| parent | aaf0d8b83901dc492d8d8ce55381b60d207b4d85 (diff) | |
| download | raylib-b5aaf33058df329963c8d7825d58131bebd13647.tar.gz raylib-b5aaf33058df329963c8d7825d58131bebd13647.zip | |
Review matrix multiplication
Diffstat (limited to 'src/models.c')
| -rw-r--r-- | src/models.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/models.c b/src/models.c index 4c5986b4..92abda69 100644 --- a/src/models.c +++ b/src/models.c @@ -1009,12 +1009,14 @@ void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int ins Matrix matModelView = MatrixIdentity(); Matrix matProjection = MatrixIdentity(); + // TODO: Review how matrices multiplications are computed! + if (instancing) { // Create instances buffer instanceTransforms = RL_MALLOC(instances*sizeof(float16)); - for (int i = 0; i < instances; i++) instanceTransforms[i] = MatrixToFloatV(transforms[i]); + for (int i = 0; i < instances; i++) instanceTransforms[i] = MatrixToFloatV(MatrixMultiply(transforms[i], rlGetMatrixModelview())); // Enable mesh VAO to attach new buffer rlEnableVertexArray(mesh.vaoId); |
