diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-12-16 03:31:38 +0300 |
---|---|---|
committer | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-12-16 03:53:48 +0300 |
commit | 0c19a043e8198018ae794145fc4f1e78d5f00923 (patch) | |
tree | 3758688cd3639adcd50b0ce298bdf758b890e4f9 /source/gameengine/Ketsji/KX_SteeringActuator.cpp | |
parent | 5b331150709616fc5aee9c1af228d48175032ea0 (diff) |
BGE Ketsji clean-up: double-promotion warnings
Diffstat (limited to 'source/gameengine/Ketsji/KX_SteeringActuator.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_SteeringActuator.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index cd2cd2bae0b..af2a2b30b84 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -169,8 +169,8 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) if (m_posevent && !m_isActive) { - delta = 0; - m_pathUpdateTime = -1; + delta = 0.0; + m_pathUpdateTime = -1.0; m_updateTime = curtime; m_isActive = true; } @@ -191,8 +191,8 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) const MT_Point3& targpos = m_target->NodeGetWorldPosition(); MT_Vector3 vectotarg = targpos - mypos; MT_Vector3 vectotarg2d = vectotarg; - vectotarg2d.z() = 0; - m_steerVec = MT_Vector3(0, 0, 0); + vectotarg2d.z() = 0.0f; + m_steerVec = MT_Vector3(0.0f, 0.0f, 0.0f); bool apply_steerforce = false; bool terminate = true; @@ -220,10 +220,10 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) { terminate = false; - static const MT_Scalar WAYPOINT_RADIUS(0.25); + static const MT_Scalar WAYPOINT_RADIUS(0.25f); if (m_pathUpdateTime<0 || (m_pathUpdatePeriod>=0 && - curtime - m_pathUpdateTime>((double)m_pathUpdatePeriod/1000))) + curtime - m_pathUpdateTime>((double)m_pathUpdatePeriod/1000.0))) { m_pathUpdateTime = curtime; m_pathLen = m_navmesh->FindPath(mypos, targpos, m_path, MAX_PATH_LENGTH); @@ -252,7 +252,7 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) if (m_enableVisualization) { //debug draw - static const MT_Vector3 PATH_COLOR(1,0,0); + static const MT_Vector3 PATH_COLOR(1.0f,0.0f,0.0f); m_navmesh->DrawPath(m_path, m_pathLen, PATH_COLOR); } } @@ -274,11 +274,11 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) if (m_simulation && m_obstacle /*&& !newvel.fuzzyZero()*/) { if (m_enableVisualization) - KX_RasterizerDrawDebugLine(mypos, mypos + newvel, MT_Vector3(1.0, 0.0, 0.0)); + KX_RasterizerDrawDebugLine(mypos, mypos + newvel, MT_Vector3(1.0f, 0.0f, 0.0f)); m_simulation->AdjustObstacleVelocity(m_obstacle, m_mode!=KX_STEERING_PATHFOLLOWING ? m_navmesh : NULL, - newvel, m_acceleration*delta, m_turnspeed/180.0f*M_PI*delta); + newvel, m_acceleration*(float)delta, m_turnspeed/(180.0f*(float)(M_PI*delta))); if (m_enableVisualization) - KX_RasterizerDrawDebugLine(mypos, mypos + newvel, MT_Vector3(0.0, 1.0, 0.0)); + KX_RasterizerDrawDebugLine(mypos, mypos + newvel, MT_Vector3(0.0f, 1.0f, 0.0f)); } HandleActorFace(newvel); |