Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPorteries Tristan <republicthunderbolt9@gmail.com>2015-12-13 04:01:28 +0300
committerJorge Bernal <jbernalmartinez@gmail.com>2015-12-13 04:09:05 +0300
commit6329e20cbb64910d0d9de357df76473f93399975 (patch)
tree66a1d773f654bed3ebe875601980a0b9f22ff451 /intern/moto
parent9df6a539a2c93c2b8fe32d0d5b564c62bbadba9a (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')
-rw-r--r--intern/moto/include/MT_CmMatrix4x4.h16
-rw-r--r--intern/moto/include/MT_Scalar.h2
-rw-r--r--intern/moto/intern/MT_CmMatrix4x4.cpp10
3 files changed, 14 insertions, 14 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);
diff --git a/intern/moto/intern/MT_CmMatrix4x4.cpp b/intern/moto/intern/MT_CmMatrix4x4.cpp
index 7a04864e48d..7eae14cb4d1 100644
--- a/intern/moto/intern/MT_CmMatrix4x4.cpp
+++ b/intern/moto/intern/MT_CmMatrix4x4.cpp
@@ -42,7 +42,7 @@ MT_CmMatrix4x4::MT_CmMatrix4x4()
-MT_CmMatrix4x4::MT_CmMatrix4x4(const float value[4][4])
+MT_CmMatrix4x4::MT_CmMatrix4x4(const MT_Scalar value[4][4])
{
for (int i=0;i<4;i++)
{
@@ -53,7 +53,7 @@ MT_CmMatrix4x4::MT_CmMatrix4x4(const float value[4][4])
-MT_CmMatrix4x4::MT_CmMatrix4x4(const double value[16])
+MT_CmMatrix4x4::MT_CmMatrix4x4(const MT_Scalar value[16])
{
for (int i=0;i<16;i++)
m_Vflat[i] = value[i];
@@ -148,21 +148,21 @@ void MT_CmMatrix4x4::SetMatrix(const MT_CmMatrix4x4& other)
-double* MT_CmMatrix4x4::getPointer()
+MT_Scalar* MT_CmMatrix4x4::getPointer()
{
return &m_V[0][0];
}
-const double* MT_CmMatrix4x4::getPointer() const
+const MT_Scalar* MT_CmMatrix4x4::getPointer() const
{
return &m_V[0][0];
}
-void MT_CmMatrix4x4::setElem(int pos,double newvalue)
+void MT_CmMatrix4x4::setElem(int pos,MT_Scalar newvalue)
{
m_Vflat[pos] = newvalue;
}