aboutsummaryrefslogtreecommitdiff
path: root/src/rlgl.c
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-02-02 18:41:01 +0100
committerRay <raysan5@gmail.com>2016-02-02 18:41:01 +0100
commitdf5c64d0beee06df8c87a43e5341b6b98f82839f (patch)
tree4ca6c04bc301afbf8947f7a812921432107a5fc8 /src/rlgl.c
parent65ecde1e75bd9e2738c8640e966328abeaa5658e (diff)
downloadraylib-df5c64d0beee06df8c87a43e5341b6b98f82839f.tar.gz
raylib-df5c64d0beee06df8c87a43e5341b6b98f82839f.zip
Functions parameters reorganize: Axis and Angle
sin(), cos() functions cached and replaced by float c99 versions sinf(), cos()
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index 49300054..48e6ac1b 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -411,7 +411,7 @@ void rlRotatef(float angleDeg, float x, float y, float z)
Vector3 axis = (Vector3){ x, y, z };
VectorNormalize(&axis);
- matRotation = MatrixRotate(angleDeg*DEG2RAD, axis);
+ matRotation = MatrixRotate(axis, angleDeg*DEG2RAD);
MatrixTranspose(&matRotation);
@@ -1406,13 +1406,13 @@ void rlglDrawPostpro(void)
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
glBindFramebuffer(GL_FRAMEBUFFER, 0);
- rlglDrawModel(postproQuad, (Vector3){0,0,0}, 0.0f, (Vector3){0,0,0}, (Vector3){1.0f, 1.0f, 1.0f}, (Color){ 255, 255, 255, 255 }, false);
+ rlglDrawModel(postproQuad, (Vector3){0,0,0}, (Vector3){0,0,0}, 0.0f, (Vector3){1.0f, 1.0f, 1.0f}, (Color){ 255, 255, 255, 255 }, false);
#endif
}
// Draw a 3d model
// NOTE: Model transform can come within model struct
-void rlglDrawModel(Model model, Vector3 position, float rotationAngle, Vector3 rotationAxis, Vector3 scale, Color color, bool wires)
+void rlglDrawModel(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color color, bool wires)
{
#if defined (GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33)
// NOTE: glPolygonMode() not available on OpenGL ES
@@ -1461,7 +1461,7 @@ void rlglDrawModel(Model model, Vector3 position, float rotationAngle, Vector3 r
// Calculate transformation matrix from function parameters
// Get transform matrix (rotation -> scale -> translation)
- Matrix matRotation = MatrixRotate(rotationAngle*DEG2RAD, rotationAxis);
+ Matrix matRotation = MatrixRotate(rotationAxis, rotationAngle*DEG2RAD);
Matrix matScale = MatrixScale(scale.x, scale.y, scale.z);
Matrix matTranslation = MatrixTranslate(position.x, position.y, position.z);
Matrix matTransform = MatrixMultiply(MatrixMultiply(matRotation, matScale), matTranslation);