Просмотр исходного кода

Review matrix multiplication

pull/1695/head
raysan5 3 лет назад
Родитель
Сommit
b5aaf33058
1 измененных файлов: 3 добавлений и 1 удалений
  1. +3
    -1
      src/models.c

+ 3
- 1
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);

Загрузка…
Отмена
Сохранить