mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-15 15:58:14 +00:00
Review spacing for cosistency
This commit is contained in:
18
src/core.c
18
src/core.c
@@ -921,7 +921,7 @@ void Begin3dMode(Camera camera)
|
|||||||
|
|
||||||
float aspect = (float)screenWidth/(float)screenHeight;
|
float aspect = (float)screenWidth/(float)screenHeight;
|
||||||
|
|
||||||
if(camera.type == CAMERA_PERSPECTIVE)
|
if (camera.type == CAMERA_PERSPECTIVE)
|
||||||
{
|
{
|
||||||
// Setup perspective projection
|
// Setup perspective projection
|
||||||
double top = 0.01*tan(camera.fovy*0.5*DEG2RAD);
|
double top = 0.01*tan(camera.fovy*0.5*DEG2RAD);
|
||||||
@@ -929,7 +929,7 @@ void Begin3dMode(Camera camera)
|
|||||||
|
|
||||||
rlFrustum(-right, right, -top, top, 0.01, 1000.0);
|
rlFrustum(-right, right, -top, top, 0.01, 1000.0);
|
||||||
}
|
}
|
||||||
else if(camera.type == CAMERA_ORTHOGRAPHIC)
|
else if (camera.type == CAMERA_ORTHOGRAPHIC)
|
||||||
{
|
{
|
||||||
// Setup orthographic projection
|
// Setup orthographic projection
|
||||||
double top = camera.fovy/2.0;
|
double top = camera.fovy/2.0;
|
||||||
@@ -1031,12 +1031,12 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
|||||||
|
|
||||||
Matrix matProj;
|
Matrix matProj;
|
||||||
|
|
||||||
if(camera.type == CAMERA_PERSPECTIVE)
|
if (camera.type == CAMERA_PERSPECTIVE)
|
||||||
{
|
{
|
||||||
// Calculate projection matrix from perspective
|
// Calculate projection matrix from perspective
|
||||||
matProj = MatrixPerspective(camera.fovy*DEG2RAD, ((double)GetScreenWidth()/(double)GetScreenHeight()), 0.01, 1000.0);
|
matProj = MatrixPerspective(camera.fovy*DEG2RAD, ((double)GetScreenWidth()/(double)GetScreenHeight()), 0.01, 1000.0);
|
||||||
}
|
}
|
||||||
else if(camera.type == CAMERA_ORTHOGRAPHIC)
|
else if (camera.type == CAMERA_ORTHOGRAPHIC)
|
||||||
{
|
{
|
||||||
float aspect = (float)screenWidth/(float)screenHeight;
|
float aspect = (float)screenWidth/(float)screenHeight;
|
||||||
double top = camera.fovy/2.0;
|
double top = camera.fovy/2.0;
|
||||||
@@ -1057,14 +1057,8 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
|||||||
// Calculate normalized direction vector
|
// Calculate normalized direction vector
|
||||||
Vector3 direction = Vector3Normalize(Vector3Subtract(farPoint, nearPoint));
|
Vector3 direction = Vector3Normalize(Vector3Subtract(farPoint, nearPoint));
|
||||||
|
|
||||||
if(camera.type == CAMERA_PERSPECTIVE)
|
if (camera.type == CAMERA_PERSPECTIVE) ray.position = camera.position;
|
||||||
{
|
else if (camera.type == CAMERA_ORTHOGRAPHIC) ray.position = cameraPlanePointerPos;
|
||||||
ray.position = camera.position;
|
|
||||||
}
|
|
||||||
else if(camera.type == CAMERA_ORTHOGRAPHIC)
|
|
||||||
{
|
|
||||||
ray.position = cameraPlanePointerPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply calculated vectors to ray
|
// Apply calculated vectors to ray
|
||||||
ray.direction = direction;
|
ray.direction = direction;
|
||||||
|
Reference in New Issue
Block a user