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:
authorJorge Bernal <jbernalmartinez@gmail.com>2015-12-16 03:52:30 +0300
committerJorge Bernal <jbernalmartinez@gmail.com>2015-12-16 03:53:48 +0300
commitee59df521f2af10d6a34158a39bf21dd5ae847a3 (patch)
treef48810bfb9d6df03542517d575d61b46b3584d89 /source/gameengine
parent0c19a043e8198018ae794145fc4f1e78d5f00923 (diff)
BGE clean up: use float version of trigonometric functions
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_System.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.cpp8
-rw-r--r--source/gameengine/Ketsji/KX_Dome.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_OrientationInterpolator.cpp12
-rw-r--r--source/gameengine/Ketsji/KX_TrackToActuator.cpp12
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp2
7 files changed, 24 insertions, 24 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_System.cpp b/source/gameengine/GamePlayer/ghost/GPG_System.cpp
index 6710572d843..669ab0532d9 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_System.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_System.cpp
@@ -46,7 +46,7 @@ double GPG_System::GetTimeInSeconds()
{
GHOST_TInt64 millis = (GHOST_TInt64)m_system->getMilliSeconds();
double time = (double)millis;
- time /= 1000.0f;
+ time /= 1000.0;
return time;
}
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index 76c7b4a222c..6988d563808 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -294,7 +294,7 @@ void KX_Camera::NormalizeClipPlanes()
for (unsigned int p = 0; p < 6; p++)
{
- MT_Scalar factor = sqrt(m_planes[p][0]*m_planes[p][0] + m_planes[p][1]*m_planes[p][1] + m_planes[p][2]*m_planes[p][2]);
+ MT_Scalar factor = sqrtf(m_planes[p][0]*m_planes[p][0] + m_planes[p][1]*m_planes[p][1] + m_planes[p][2]*m_planes[p][2]);
if (!MT_fuzzyZero(factor))
m_planes[p] /= factor;
}
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
index 8f15955fba6..27c074393b4 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
@@ -96,10 +96,10 @@ KX_ConstraintActuator::KX_ConstraintActuator(SCA_IObject *gameobj,
m_refDirection[2] /= len;
m_refDirVector /= len;
}
- m_minimumBound = cos(minBound);
- m_maximumBound = cos(maxBound);
- m_minimumSine = sin(minBound);
- m_maximumSine = sin(maxBound);
+ m_minimumBound = cosf(minBound);
+ m_maximumBound = cosf(maxBound);
+ m_minimumSine = sinf(minBound);
+ m_maximumSine = sinf(maxBound);
}
break;
default:
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp
index 08cdc108c64..818a46531c9 100644
--- a/source/gameengine/Ketsji/KX_Dome.cpp
+++ b/source/gameengine/Ketsji/KX_Dome.cpp
@@ -1476,9 +1476,9 @@ void KX_Dome::CalculateCameraOrientation()
* Uses 6 cameras for angles up to 360deg
*/
int i;
- float deg45 = MT_PI / 4;
- MT_Scalar c = cos(deg45);
- MT_Scalar s = sin(deg45);
+ float deg45 = MT_PI / 4.0f;
+ MT_Scalar c = cosf(deg45);
+ MT_Scalar s = sinf(deg45);
if (m_angle <= 180 && (m_mode == DOME_FISHEYE
|| m_mode == DOME_TRUNCATED_FRONT
@@ -1575,8 +1575,8 @@ void KX_Dome::CalculateCameraOrientation()
if (m_tilt)
{
float tiltdeg = ((m_tilt % 360) * 2 * MT_PI) / 360;
- c = cos(tiltdeg);
- s = sin(tiltdeg);
+ c = cosf(tiltdeg);
+ s = sinf(tiltdeg);
MT_Matrix3x3 tilt_mat = MT_Matrix3x3(
1.0f, 0.0f, 0.0f,
diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.cpp b/source/gameengine/Ketsji/KX_OrientationInterpolator.cpp
index d2468d0317d..bcaa1e60e92 100644
--- a/source/gameengine/Ketsji/KX_OrientationInterpolator.cpp
+++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.cpp
@@ -39,12 +39,12 @@ void KX_OrientationInterpolator::Execute(float currentTime) const
MT_Vector3 eul(m_ipos[0]->GetValue(currentTime),
m_ipos[1]->GetValue(currentTime),
m_ipos[2]->GetValue(currentTime));
- MT_Scalar ci = cos(eul[0]);
- MT_Scalar cj = cos(eul[1]);
- MT_Scalar ch = cos(eul[2]);
- MT_Scalar si = sin(eul[0]);
- MT_Scalar sj = sin(eul[1]);
- MT_Scalar sh = sin(eul[2]);
+ MT_Scalar ci = cosf(eul[0]);
+ MT_Scalar cj = cosf(eul[1]);
+ MT_Scalar ch = cosf(eul[2]);
+ MT_Scalar si = sinf(eul[0]);
+ MT_Scalar sj = sinf(eul[1]);
+ MT_Scalar sh = sinf(eul[2]);
MT_Scalar cc = ci*ch;
MT_Scalar cs = ci*sh;
MT_Scalar sc = si*ch;
diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
index 651cc473640..74902ab20ee 100644
--- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp
+++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
@@ -92,12 +92,12 @@ static MT_Matrix3x3 EulToMat3(float eul[3])
MT_Matrix3x3 mat;
float ci, cj, ch, si, sj, sh, cc, cs, sc, ss;
- ci = cos(eul[0]);
- cj = cos(eul[1]);
- ch = cos(eul[2]);
- si = sin(eul[0]);
- sj = sin(eul[1]);
- sh = sin(eul[2]);
+ ci = cosf(eul[0]);
+ cj = cosf(eul[1]);
+ ch = cosf(eul[2]);
+ si = sinf(eul[0]);
+ sj = sinf(eul[1]);
+ sh = sinf(eul[2]);
cc = ci*ch;
cs = ci*sh;
sc = si*ch;
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
index 604b6a6b59b..84dbfff74b0 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
@@ -404,7 +404,7 @@ void RAS_OpenGLRasterizer::FlushDebugShapes(SCA_IScene *scene)
for (int j = 0; j<n; j++)
{
MT_Scalar theta = j*(float)M_PI*2/n;
- MT_Vector3 pos(cos(theta) * rad, sin(theta) * rad, 0.0f);
+ MT_Vector3 pos(cosf(theta) * rad, sinf(theta) * rad, 0.0f);
pos = pos*tr;
pos += debugShapes[i].m_pos;
const MT_Scalar* posPtr = &pos.x();