Review matrix multiplication
This commit is contained in:
parent
aaf0d8b839
commit
b5aaf33058
1 changed files with 3 additions and 1 deletions
|
@ -1009,12 +1009,14 @@ void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int ins
|
||||||
Matrix matModelView = MatrixIdentity();
|
Matrix matModelView = MatrixIdentity();
|
||||||
Matrix matProjection = MatrixIdentity();
|
Matrix matProjection = MatrixIdentity();
|
||||||
|
|
||||||
|
// TODO: Review how matrices multiplications are computed!
|
||||||
|
|
||||||
if (instancing)
|
if (instancing)
|
||||||
{
|
{
|
||||||
// Create instances buffer
|
// Create instances buffer
|
||||||
instanceTransforms = RL_MALLOC(instances*sizeof(float16));
|
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
|
// Enable mesh VAO to attach new buffer
|
||||||
rlEnableVertexArray(mesh.vaoId);
|
rlEnableVertexArray(mesh.vaoId);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue