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:
authorCampbell Barton <ideasman42@gmail.com>2012-07-21 19:27:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-21 19:27:40 +0400
commit62a73381a7ec63e75960d3c9545c638c85d3b06a (patch)
tree25d16dfc4c245bacb98c3737c3817d1a52ce8d93 /source/gameengine
parent1bb7cfded603028db0d52b3c0917900e83b858e6 (diff)
use fabsf when using floats.
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.cpp2
-rw-r--r--source/gameengine/VideoTexture/ImageRender.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index c5145ef2171..b005684a6db 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1162,8 +1162,8 @@ void KX_GameObject::NodeSetWorldScale(const MT_Vector3& scale)
{
// Make sure the objects have some scale
MT_Vector3 p_scale = parent->GetWorldScaling();
- if (fabs(p_scale[0]) < FLT_EPSILON ||
- fabs(p_scale[1]) < FLT_EPSILON ||
+ if (fabs(p_scale[0]) < FLT_EPSILON ||
+ fabs(p_scale[1]) < FLT_EPSILON ||
fabs(p_scale[2]) < FLT_EPSILON)
{
return;
@@ -1190,8 +1190,8 @@ void KX_GameObject::NodeSetWorldPosition(const MT_Point3& trans)
{
// Make sure the objects have some scale
MT_Vector3 scale = parent->GetWorldScaling();
- if (fabs(scale[0]) < FLT_EPSILON ||
- fabs(scale[1]) < FLT_EPSILON ||
+ if (fabs(scale[0]) < FLT_EPSILON ||
+ fabs(scale[1]) < FLT_EPSILON ||
fabs(scale[2]) < FLT_EPSILON)
{
return;
@@ -1203,7 +1203,7 @@ void KX_GameObject::NodeSetWorldPosition(const MT_Point3& trans)
MT_Vector3 newpos = invori*(trans-parent->GetWorldPosition())*scale;
NodeSetLocalPosition(MT_Point3(newpos[0],newpos[1],newpos[2]));
}
- else
+ else
{
NodeSetLocalPosition(trans);
}
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp
index 7e7e7f8cef2..5599f3e31c6 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.cpp
+++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp
@@ -379,7 +379,7 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
void KX_IpoActuator::ResetStartTime()
{
- this->m_starttime = -2.0*fabs(this->m_endframe - this->m_startframe) - 1.0;
+ this->m_starttime = -2.0f * fabsf(this->m_endframe - this->m_startframe) - 1.0f;
}
int KX_IpoActuator::string2mode(const char *modename)
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp
index 97e52e3af3d..2cc2c6efa1e 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -637,8 +637,8 @@ ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObj
// otherwise the Y axis is the up direction.
// If the mirror is not perfectly vertical(horizontal), the Z(Y) axis projection on the mirror
// plan by the normal will be the up direction.
- if (fabs(mirrorNormal[2]) > fabs(mirrorNormal[1]) &&
- fabs(mirrorNormal[2]) > fabs(mirrorNormal[0]))
+ if (fabsf(mirrorNormal[2]) > fabsf(mirrorNormal[1]) &&
+ fabsf(mirrorNormal[2]) > fabsf(mirrorNormal[0]))
{
// the mirror is more horizontal than vertical
copy_v3_v3(axis, yaxis);
@@ -649,7 +649,7 @@ ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObj
copy_v3_v3(axis, zaxis);
}
dist = dot_v3v3(mirrorNormal, axis);
- if (fabs(dist) < FLT_EPSILON)
+ if (fabsf(dist) < FLT_EPSILON)
{
// the mirror is already fully aligned with up axis
copy_v3_v3(mirrorUp, axis);