summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorRay <[email protected]>2020-01-24 18:35:58 +0100
committerRay <[email protected]>2020-01-24 18:35:58 +0100
commit40d6c15798697c3c535aedebf51040e3661f16a1 (patch)
tree7f5faf96e83fd069275d61419fc60603b826304d /src/core.c
parentd41386d661518150091e5c3ecf01c440b1d995c9 (diff)
downloadraylib-40d6c15798697c3c535aedebf51040e3661f16a1.tar.gz
raylib-40d6c15798697c3c535aedebf51040e3661f16a1.zip
Addressed issue #1051
Allow frustrum culling near/far distance configuration at compile time.
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core.c b/src/core.c
index cb682652..7d7cf4bf 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1331,7 +1331,7 @@ void BeginMode3D(Camera3D camera)
double top = 0.01*tan(camera.fovy*0.5*DEG2RAD);
double right = top*aspect;
- rlFrustum(-right, right, -top, top, 0.01, 1000.0);
+ rlFrustum(-right, right, -top, top, DEFAULT_NEAR_CULL_DISTANCE, DEFAULT_FAR_CULL_DISTANCE);
}
else if (camera.type == CAMERA_ORTHOGRAPHIC)
{
@@ -1339,7 +1339,7 @@ void BeginMode3D(Camera3D camera)
double top = camera.fovy/2.0;
double right = top*aspect;
- rlOrtho(-right,right,-top,top, 0.01, 1000.0);
+ rlOrtho(-right, right, -top,top, DEFAULT_NEAR_CULL_DISTANCE, DEFAULT_FAR_CULL_DISTANCE);
}
// NOTE: zNear and zFar values are important when computing depth buffer values
@@ -1452,7 +1452,7 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
if (camera.type == CAMERA_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()), DEFAULT_NEAR_CULL_DISTANCE, DEFAULT_FAR_CULL_DISTANCE);
}
else if (camera.type == CAMERA_ORTHOGRAPHIC)
{
@@ -1528,7 +1528,7 @@ Vector2 GetWorldToScreen(Vector3 position, Camera camera)
if (camera.type == CAMERA_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()), DEFAULT_NEAR_CULL_DISTANCE, DEFAULT_FAR_CULL_DISTANCE);
}
else if (camera.type == CAMERA_ORTHOGRAPHIC)
{