From e52032f64660008fdcf0c8d707ef6aed1e6fc32f Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 21 Jul 2017 17:19:28 +0200 Subject: Complete review of raymath Now it should be coherent with OpenGL math standards --- src/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index 32d4666b..5e7cc811 100644 --- a/src/core.c +++ b/src/core.c @@ -895,8 +895,8 @@ void Begin3dMode(Camera camera) rlLoadIdentity(); // Reset current matrix (MODELVIEW) // Setup Camera view - Matrix cameraView = MatrixLookAt(camera.position, camera.target, camera.up); - rlMultMatrixf(MatrixToFloat(cameraView)); // Multiply MODELVIEW matrix by view matrix (camera) + Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); + rlMultMatrixf(MatrixToFloat(matView)); // Multiply MODELVIEW matrix by view matrix (camera) rlEnableDepthTest(); // Enable DEPTH_TEST for 3D } @@ -991,7 +991,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) // For example, if you get view matrix, transpose and inverted and you transform it // to a vector, you will get its 3d world position coordinates (camera.position). // If you don't transpose, final position will be wrong. - MatrixTranspose(&matView); + //MatrixTranspose(&matView); //#define USE_RLGL_UNPROJECT #if defined(USE_RLGL_UNPROJECT) // OPTION 1: Use rlUnproject() @@ -1037,7 +1037,6 @@ Vector2 GetWorldToScreen(Vector3 position, Camera camera) // Calculate view matrix from camera look at (and transpose it) Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); - MatrixTranspose(&matView); // Convert world position vector to quaternion Quaternion worldPos = { position.x, position.y, position.z, 1.0f }; -- cgit v1.2.3