mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-10 13:28:16 +00:00
Some warnings review
This commit is contained in:
@@ -1026,7 +1026,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
|||||||
// Calculate view matrix from camera look at
|
// Calculate view matrix from camera look at
|
||||||
Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up);
|
Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up);
|
||||||
|
|
||||||
Matrix matProj;
|
Matrix matProj = MatrixIdentity();
|
||||||
|
|
||||||
if (camera.type == CAMERA_PERSPECTIVE)
|
if (camera.type == CAMERA_PERSPECTIVE)
|
||||||
{
|
{
|
||||||
@@ -1038,6 +1038,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
|||||||
float aspect = (float)screenWidth/(float)screenHeight;
|
float aspect = (float)screenWidth/(float)screenHeight;
|
||||||
double top = camera.fovy/2.0;
|
double top = camera.fovy/2.0;
|
||||||
double right = top*aspect;
|
double right = top*aspect;
|
||||||
|
|
||||||
// Calculate projection matrix from orthographic
|
// Calculate projection matrix from orthographic
|
||||||
matProj = MatrixOrtho(-right, right, -top, top, 0.01, 1000.0);
|
matProj = MatrixOrtho(-right, right, -top, top, 0.01, 1000.0);
|
||||||
}
|
}
|
||||||
@@ -1067,7 +1068,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
|||||||
Vector2 GetWorldToScreen(Vector3 position, Camera camera)
|
Vector2 GetWorldToScreen(Vector3 position, Camera camera)
|
||||||
{
|
{
|
||||||
// Calculate projection matrix (from perspective instead of frustum
|
// Calculate projection matrix (from perspective instead of frustum
|
||||||
Matrix matProj;
|
Matrix matProj = MatrixIdentity();
|
||||||
|
|
||||||
if (camera.type == CAMERA_PERSPECTIVE)
|
if (camera.type == CAMERA_PERSPECTIVE)
|
||||||
{
|
{
|
||||||
@@ -1079,6 +1080,7 @@ Vector2 GetWorldToScreen(Vector3 position, Camera camera)
|
|||||||
float aspect = (float)screenWidth/(float)screenHeight;
|
float aspect = (float)screenWidth/(float)screenHeight;
|
||||||
double top = camera.fovy/2.0;
|
double top = camera.fovy/2.0;
|
||||||
double right = top*aspect;
|
double right = top*aspect;
|
||||||
|
|
||||||
// Calculate projection matrix from orthographic
|
// Calculate projection matrix from orthographic
|
||||||
matProj = MatrixOrtho(-right, right, -top, top, 0.01, 1000.0);
|
matProj = MatrixOrtho(-right, right, -top, top, 0.01, 1000.0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user