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:
Diffstat (limited to 'source/gameengine/Ketsji/KX_SteeringActuator.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_SteeringActuator.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
index 10d4273a2b4..83597f9125a 100644
--- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp
@@ -263,12 +263,12 @@ bool KX_SteeringActuator::Update(double curtime, bool frame)
if (apply_steerforce)
{
- MT_Vector3 newvel;
bool isdyna = obj->IsDynamic();
if (isdyna)
m_steerVec.z() = 0;
if (!m_steerVec.fuzzyZero())
m_steerVec.normalize();
+ MT_Vector3 newvel = m_velocity * m_steerVec;
//adjust velocity to avoid obstacles
if (m_simulation && m_obstacle /*&& !newvel.fuzzyZero()*/)
@@ -284,13 +284,10 @@ bool KX_SteeringActuator::Update(double curtime, bool frame)
HandleActorFace(newvel);
if (isdyna)
{
- //TODO: Take into account angular velocity on turns
+ //temporary solution: set 2D steering velocity directly to obj
+ //correct way is to apply physical force
MT_Vector3 curvel = obj->GetLinearVelocity();
- newvel = (curvel.length() * m_steerVec) + (m_acceleration * delta) * m_steerVec;
- if (newvel.length2() >= (m_velocity * m_velocity))
- newvel = m_velocity * m_steerVec;
-
if (m_lockzvel)
newvel.z() = 0.0f;
else