|
|
@ -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.fovyo">*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.fovyo">*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); |
|
|
|