diff options
| author | Joshua Reisenauer <kd7tck@msn.com> | 2016-06-07 16:07:57 -0700 |
|---|---|---|
| committer | Joshua Reisenauer <kd7tck@msn.com> | 2016-06-07 16:07:57 -0700 |
| commit | 7bf2854e949a073535109327d18303ee31d0c322 (patch) | |
| tree | c55e9a71cabf53279bf7f384251ca3549f36e6b9 /examples/oculus_glfw_sample/raymath.h | |
| parent | f0d8c009ae9bd1d8e7f17f76fe0658b257cf16de (diff) | |
| parent | 79a6235811de391d8ae9d0b90bf39c2160dc7907 (diff) | |
| download | raylib-7bf2854e949a073535109327d18303ee31d0c322.tar.gz raylib-7bf2854e949a073535109327d18303ee31d0c322.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'examples/oculus_glfw_sample/raymath.h')
| -rw-r--r-- | examples/oculus_glfw_sample/raymath.h | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/examples/oculus_glfw_sample/raymath.h b/examples/oculus_glfw_sample/raymath.h index 2e055e9f..4075a1a9 100644 --- a/examples/oculus_glfw_sample/raymath.h +++ b/examples/oculus_glfw_sample/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 //---------------------------------------------------------------------------------- |
