summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2019-11-25 11:29:04 +0100
committerRay <[email protected]>2019-11-25 11:29:04 +0100
commit97abaff4c5daad57c50822fb15b790a7241c7775 (patch)
tree6fa1b85b179e340c9cfee9ad7158fe6627d1dc38 /src
parent5ad65d9291c446eb4c7c54ff17c2bf11cdf6a118 (diff)
downloadraylib-97abaff4c5daad57c50822fb15b790a7241c7775.tar.gz
raylib-97abaff4c5daad57c50822fb15b790a7241c7775.zip
Support rlPushMatrix() and rlPopMatrix() on mesh drawing
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 5c71c478..1297c53d 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -2664,16 +2664,13 @@ void rlDrawMesh(Mesh mesh, Material material, Matrix transform)
Matrix matView = modelview; // View matrix (camera)
Matrix matProjection = projection; // Projection matrix (perspective)
- // TODO: Matrix nightmare! Trying to combine stack matrices with view matrix and local model transform matrix..
- // There is some problem in the order matrices are multiplied... it requires some time to figure out...
- Matrix matStackTransform = MatrixIdentity();
-
// TODO: Consider possible transform matrices in the stack
// Is this the right order? or should we start with the first stored matrix instead of the last one?
+ //Matrix matStackTransform = MatrixIdentity();
//for (int i = stackCounter; i > 0; i--) matStackTransform = MatrixMultiply(stack[i], matStackTransform);
- Matrix matModel = MatrixMultiply(transform, matStackTransform); // Apply local model transformation
- Matrix matModelView = MatrixMultiply(matModel, matView); // Transform to camera-space coordinates
+ // Transform to camera-space coordinates
+ Matrix matModelView = MatrixMultiply(transform, MatrixMultiply(transformMatrix, matView));
//-----------------------------------------------------
// Bind active texture maps (if available)