aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2018-04-19 20:19:53 +0200
committerRay <raysan5@gmail.com>2018-04-19 20:19:53 +0200
commit76a6bf6c52ccef16ce0ba96e5bdb323a91bc8675 (patch)
tree4450a54260516a7124b5c2f5e6d14d6b72f9dea8 /src
parentafda1d081535e28c104e3b1753ec28cd930e0d48 (diff)
downloadraylib-76a6bf6c52ccef16ce0ba96e5bdb323a91bc8675.tar.gz
raylib-76a6bf6c52ccef16ce0ba96e5bdb323a91bc8675.zip
Review spacing for cosistency
Diffstat (limited to 'src')
-rw-r--r--src/core.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/core.c b/src/core.c
index c1187e5a..7772027b 100644
--- a/src/core.c
+++ b/src/core.c
@@ -921,7 +921,7 @@ void Begin3dMode(Camera camera)
float aspect = (float)screenWidth/(float)screenHeight;
- if(camera.type == CAMERA_PERSPECTIVE)
+ if (camera.type == CAMERA_PERSPECTIVE)
{
// Setup perspective projection
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);
}
- else if(camera.type == CAMERA_ORTHOGRAPHIC)
+ else if (camera.type == CAMERA_ORTHOGRAPHIC)
{
// Setup orthographic projection
double top = camera.fovy/2.0;
@@ -1031,12 +1031,12 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
Matrix matProj;
- if(camera.type == CAMERA_PERSPECTIVE)
+ if (camera.type == CAMERA_PERSPECTIVE)
{
// Calculate projection matrix from perspective
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;
double top = camera.fovy/2.0;
@@ -1057,14 +1057,8 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
// Calculate normalized direction vector
Vector3 direction = Vector3Normalize(Vector3Subtract(farPoint, nearPoint));
- if(camera.type == CAMERA_PERSPECTIVE)
- {
- ray.position = camera.position;
- }
- else if(camera.type == CAMERA_ORTHOGRAPHIC)
- {
- ray.position = cameraPlanePointerPos;
- }
+ if (camera.type == CAMERA_PERSPECTIVE) ray.position = camera.position;
+ else if (camera.type == CAMERA_ORTHOGRAPHIC) ray.position = cameraPlanePointerPos;
// Apply calculated vectors to ray
ray.direction = direction;