mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-15 07:48:15 +00:00
MatrixPerspective() angle required in radians
Consistent with similar functions in raymath
This commit is contained in:
@@ -980,7 +980,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
||||
TraceLog(LOG_DEBUG, "Device coordinates: (%f, %f, %f)", deviceCoords.x, deviceCoords.y, deviceCoords.z);
|
||||
|
||||
// Calculate projection matrix (from perspective instead of frustum)
|
||||
Matrix matProj = MatrixPerspective(camera.fovy, ((double)GetScreenWidth()/(double)GetScreenHeight()), 0.01, 1000.0);
|
||||
Matrix matProj = MatrixPerspective(camera.fovy*DEG2RAD, ((double)GetScreenWidth()/(double)GetScreenHeight()), 0.01, 1000.0);
|
||||
|
||||
// Calculate view matrix from camera look at
|
||||
Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up);
|
||||
@@ -1033,7 +1033,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
||||
Vector2 GetWorldToScreen(Vector3 position, Camera camera)
|
||||
{
|
||||
// Calculate projection matrix (from perspective instead of frustum
|
||||
Matrix matProj = MatrixPerspective(camera.fovy, (double)GetScreenWidth()/(double)GetScreenHeight(), 0.01, 1000.0);
|
||||
Matrix matProj = MatrixPerspective(camera.fovy*DEG2RAD, (double)GetScreenWidth()/(double)GetScreenHeight(), 0.01, 1000.0);
|
||||
|
||||
// Calculate view matrix from camera look at (and transpose it)
|
||||
Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up);
|
||||
|
Reference in New Issue
Block a user