diff options
| author | Ray <[email protected]> | 2023-07-10 19:29:10 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-07-10 19:29:10 +0200 |
| commit | 2061bfc5e814dd4e2b5ff629cb02bef4c972e9f8 (patch) | |
| tree | 0f97a67f90aeeb8fa7943d4676703bdf558bfa89 /src | |
| parent | bc40012ca3d719ece17f8ba28865ccb6cdf8bbcf (diff) | |
| download | raylib-2061bfc5e814dd4e2b5ff629cb02bef4c972e9f8.tar.gz raylib-2061bfc5e814dd4e2b5ff629cb02bef4c972e9f8.zip | |
Reviewed parameter names to avoid issues #3159
Diffstat (limited to 'src')
| -rw-r--r-- | src/raymath.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/raymath.h b/src/raymath.h index d7ec1d25..9281691f 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -1509,11 +1509,11 @@ RMAPI Matrix MatrixFrustum(double left, double right, double bottom, double top, // Get perspective projection matrix // NOTE: Fovy angle must be provided in radians -RMAPI Matrix MatrixPerspective(double fovy, double aspect, double near, double far) +RMAPI Matrix MatrixPerspective(double fovY, double aspect, double nearPlane, double farPlane) { Matrix result = { 0 }; - double top = near*tan(fovy*0.5); + double top = nearPlane*tan(fovY*0.5); double bottom = -top; double right = top*aspect; double left = -right; @@ -1521,27 +1521,27 @@ RMAPI Matrix MatrixPerspective(double fovy, double aspect, double near, double f // MatrixFrustum(-right, right, -top, top, near, far); float rl = (float)(right - left); float tb = (float)(top - bottom); - float fn = (float)(far - near); + float fn = (float)(farPlane - nearPlane); - result.m0 = ((float)near*2.0f)/rl; - result.m5 = ((float)near*2.0f)/tb; + result.m0 = ((float)nearPlane*2.0f)/rl; + result.m5 = ((float)nearPlane*2.0f)/tb; result.m8 = ((float)right + (float)left)/rl; result.m9 = ((float)top + (float)bottom)/tb; - result.m10 = -((float)far + (float)near)/fn; + result.m10 = -((float)farPlane + (float)nearPlane)/fn; result.m11 = -1.0f; - result.m14 = -((float)far*(float)near*2.0f)/fn; + result.m14 = -((float)farPlane*(float)nearPlane*2.0f)/fn; return result; } // Get orthographic projection matrix -RMAPI Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far) +RMAPI Matrix MatrixOrtho(double left, double right, double bottom, double top, double nearPlane, double farPlane) { Matrix result = { 0 }; float rl = (float)(right - left); float tb = (float)(top - bottom); - float fn = (float)(far - near); + float fn = (float)(farPlane - nearPlane); result.m0 = 2.0f/rl; result.m1 = 0.0f; @@ -1557,7 +1557,7 @@ RMAPI Matrix MatrixOrtho(double left, double right, double bottom, double top, d result.m11 = 0.0f; result.m12 = -((float)left + (float)right)/rl; result.m13 = -((float)top + (float)bottom)/tb; - result.m14 = -((float)far + (float)near)/fn; + result.m14 = -((float)farPlane + (float)nearPlane)/fn; result.m15 = 1.0f; return result; |
