aboutsummaryrefslogtreecommitdiff
path: root/src/raymath.h
diff options
context:
space:
mode:
authorJoshua Reisenauer <kd7tck@msn.com>2016-06-02 13:43:11 -0700
committerJoshua Reisenauer <kd7tck@msn.com>2016-06-02 13:43:11 -0700
commit96fa716525e22f9f75575f2dc1b431c58567d8a1 (patch)
treeb79a76033bf94e9f25cad98f0529cdd455a67e5f /src/raymath.h
parentcf2975d062a991d69fde60c3cdc043a8a39a09dc (diff)
parent4bc339ea4e5d833558ad4bcf14cd41e2a48a1d83 (diff)
downloadraylib-96fa716525e22f9f75575f2dc1b431c58567d8a1.tar.gz
raylib-96fa716525e22f9f75575f2dc1b431c58567d8a1.zip
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/raymath.h')
-rw-r--r--src/raymath.h21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/raymath.h b/src/raymath.h
index 2e055e9f..4075a1a9 100644
--- a/src/raymath.h
+++ b/src/raymath.h
@@ -151,7 +151,6 @@ RMDEF Matrix MatrixFrustum(double left, double right, double bottom, double top,
RMDEF Matrix MatrixPerspective(double fovy, double aspect, double near, double far); // Returns perspective projection matrix
RMDEF Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far); // Returns orthographic projection matrix
RMDEF Matrix MatrixLookAt(Vector3 position, Vector3 target, Vector3 up); // Returns camera look-at matrix (view matrix)
-RMDEF void PrintMatrix(Matrix m); // Print matrix utility
//------------------------------------------------------------------------------------
// Functions Declaration to work with Quaternions
@@ -178,9 +177,7 @@ RMDEF void QuaternionTransform(Quaternion *q, Matrix mat); // Transfo
#if defined(RAYMATH_IMPLEMENTATION) || defined(RAYMATH_EXTERN_INLINE)
-#include <stdio.h> // Used only on PrintMatrix()
-#include <math.h> // Standard math libary: sin(), cos(), tan()...
-#include <stdlib.h> // Used for abs()
+#include <math.h> // Required for: sinf(), cosf(), tan(), fabs()
//----------------------------------------------------------------------------------
// Module Functions Definition - Vector3 math
@@ -342,15 +339,14 @@ RMDEF Vector3 VectorReflect(Vector3 vector, Vector3 normal)
return result;
}
-// Transforms a Vector3 with a given Matrix
+// Transforms a Vector3 by a given Matrix
+// TODO: Review math (matrix transpose required?)
RMDEF void VectorTransform(Vector3 *v, Matrix mat)
{
float x = v->x;
float y = v->y;
float z = v->z;
- //MatrixTranspose(&mat);
-
v->x = mat.m0*x + mat.m4*y + mat.m8*z + mat.m12;
v->y = mat.m1*x + mat.m5*y + mat.m9*z + mat.m13;
v->z = mat.m2*x + mat.m6*y + mat.m10*z + mat.m14;
@@ -871,17 +867,6 @@ RMDEF Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up)
return result;
}
-// Print matrix utility (for debug)
-RMDEF void PrintMatrix(Matrix m)
-{
- printf("----------------------\n");
- printf("%2.2f %2.2f %2.2f %2.2f\n", m.m0, m.m4, m.m8, m.m12);
- printf("%2.2f %2.2f %2.2f %2.2f\n", m.m1, m.m5, m.m9, m.m13);
- printf("%2.2f %2.2f %2.2f %2.2f\n", m.m2, m.m6, m.m10, m.m14);
- printf("%2.2f %2.2f %2.2f %2.2f\n", m.m3, m.m7, m.m11, m.m15);
- printf("----------------------\n");
-}
-
//----------------------------------------------------------------------------------
// Module Functions Definition - Quaternion math
//----------------------------------------------------------------------------------