aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-01-04 20:02:57 +0100
committerraysan5 <raysan5@gmail.com>2016-01-04 20:02:57 +0100
commit891c4a458a2fb03737c75def69dd6b0d67d38ad5 (patch)
treeebd481cfb2e40983ad01b33703e1f32edb1e1c44 /src
parent70d405b41bcbbd73b9f752f4dc3910100abd1a36 (diff)
downloadraylib-891c4a458a2fb03737c75def69dd6b0d67d38ad5.tar.gz
raylib-891c4a458a2fb03737c75def69dd6b0d67d38ad5.zip
Matrix variables renaming
Diffstat (limited to 'src')
-rw-r--r--src/core.c12
-rw-r--r--src/rlgl.c20
2 files changed, 16 insertions, 16 deletions
diff --git a/src/core.c b/src/core.c
index 06260281..c07f2f86 100644
--- a/src/core.c
+++ b/src/core.c
@@ -774,8 +774,8 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
{
Ray ray;
- Matrix proj = MatrixIdentity();
- Matrix view = MatrixLookAt(camera.position, camera.target, camera.up);
+ Matrix matProj = MatrixIdentity();
+ Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up);
// Calculate projection matrix for the camera
float aspect = (float)GetScreenWidth()/(float)GetScreenHeight();
@@ -783,8 +783,8 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
double right = top*aspect;
// NOTE: zNear and zFar values are important for depth
- proj = MatrixFrustum(-right, right, -top, top, 0.01f, 1000.0f);
- MatrixTranspose(&proj);
+ matProj = MatrixFrustum(-right, right, -top, top, 0.01f, 1000.0f);
+ MatrixTranspose(&matProj);
// NOTE: Our screen origin is top-left instead of bottom-left: transform required!
float invertedMouseY = (float)GetScreenHeight() - mousePosition.y;
@@ -797,8 +797,8 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
Vector3 nearPoint = { mousePosition.x, invertedMouseY, 0.0f };
Vector3 farPoint = { mousePosition.x, invertedMouseY, 1.0f };
- nearPoint = rlglUnproject(nearPoint, proj, view);
- farPoint = rlglUnproject(farPoint, proj, view); // TODO: it seems it doesn't work...
+ nearPoint = rlglUnproject(nearPoint, matProj, matView);
+ farPoint = rlglUnproject(farPoint, matProj, matView); // TODO: it seems it doesn't work...
Vector3 direction = VectorSubtract(farPoint, nearPoint);
VectorNormalize(&direction);
diff --git a/src/rlgl.c b/src/rlgl.c
index 504381b2..4531f2d8 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -397,33 +397,33 @@ void rlLoadIdentity(void)
// Multiply the current matrix by a translation matrix
void rlTranslatef(float x, float y, float z)
{
- Matrix mat = MatrixTranslate(x, y, z);
- MatrixTranspose(&mat);
+ Matrix matTranslation = MatrixTranslate(x, y, z);
+ MatrixTranspose(&matTranslation);
- *currentMatrix = MatrixMultiply(*currentMatrix, mat);
+ *currentMatrix = MatrixMultiply(*currentMatrix, matTranslation);
}
// Multiply the current matrix by a rotation matrix
void rlRotatef(float angleDeg, float x, float y, float z)
{
- Matrix rotation = MatrixIdentity();
+ Matrix matRotation = MatrixIdentity();
Vector3 axis = (Vector3){ x, y, z };
VectorNormalize(&axis);
- rotation = MatrixRotate(angleDeg*DEG2RAD, axis);
+ matRotation = MatrixRotate(angleDeg*DEG2RAD, axis);
- MatrixTranspose(&rotation);
+ MatrixTranspose(&matRotation);
- *currentMatrix = MatrixMultiply(*currentMatrix, rotation);
+ *currentMatrix = MatrixMultiply(*currentMatrix, matRotation);
}
// Multiply the current matrix by a scaling matrix
void rlScalef(float x, float y, float z)
{
- Matrix mat = MatrixScale(x, y, z);
- MatrixTranspose(&mat);
+ Matrix matScale = MatrixScale(x, y, z);
+ MatrixTranspose(&matScale);
- *currentMatrix = MatrixMultiply(*currentMatrix, mat);
+ *currentMatrix = MatrixMultiply(*currentMatrix, matScale);
}
// Multiply the current matrix by another matrix