diff options
author | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-12-13 04:01:28 +0300 |
---|---|---|
committer | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-12-13 04:09:05 +0300 |
commit | 6329e20cbb64910d0d9de357df76473f93399975 (patch) | |
tree | 66a1d773f654bed3ebe875601980a0b9f22ff451 /intern/moto/include | |
parent | 9df6a539a2c93c2b8fe32d0d5b564c62bbadba9a (diff) |
BGE: Use float as default instead of double in Moto library.
Use float in moto instead of double for MT_Scalar.
This switch allow future optimization like SSE.
Additionally, it changes the OpenGL calls to float versions as they are
very bad with doubles.
Reviewers: campbellbarton, moguri, lordloki
Reviewed By: lordloki
Subscribers: brecht, lordloki
Differential Revision: https://developer.blender.org/D1610
Diffstat (limited to 'intern/moto/include')
-rw-r--r-- | intern/moto/include/MT_CmMatrix4x4.h | 16 | ||||
-rw-r--r-- | intern/moto/include/MT_Scalar.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/intern/moto/include/MT_CmMatrix4x4.h b/intern/moto/include/MT_CmMatrix4x4.h index 2b710c66888..53fdd41fb28 100644 --- a/intern/moto/include/MT_CmMatrix4x4.h +++ b/intern/moto/include/MT_CmMatrix4x4.h @@ -55,7 +55,7 @@ class MT_CmMatrix4x4 public : MT_CmMatrix4x4( - const float value[4][4] + const MT_Scalar value[4][4] ); MT_CmMatrix4x4( @@ -63,7 +63,7 @@ public : MT_CmMatrix4x4( - const double value[16] + const MT_Scalar value[16] ); MT_CmMatrix4x4( @@ -85,19 +85,19 @@ public : const MT_CmMatrix4x4 & other ); - double* + MT_Scalar* getPointer( ); const - double* + MT_Scalar* getPointer( ) const; void setElem( int pos, - double newvalue + MT_Scalar newvalue ); MT_Vector3 @@ -121,7 +121,7 @@ public : const MT_Vector3 & v ); - double& + MT_Scalar& operator ( ) (int row,int col) { return m_V[col][row]; } @@ -139,8 +139,8 @@ public : protected: union { - double m_V[4][4]; - double m_Vflat[16]; + MT_Scalar m_V[4][4]; + MT_Scalar m_Vflat[16]; }; }; diff --git a/intern/moto/include/MT_Scalar.h b/intern/moto/include/MT_Scalar.h index 5e516292d77..6082e2d5368 100644 --- a/intern/moto/include/MT_Scalar.h +++ b/intern/moto/include/MT_Scalar.h @@ -52,7 +52,7 @@ #include "MT_random.h" -typedef double MT_Scalar; //this should be float ! +typedef float MT_Scalar; const MT_Scalar MT_DEGS_PER_RAD(57.29577951308232286465); |