diff options
author | Nick Samarin <nicks1987@bigmir.net> | 2010-08-04 23:32:37 +0400 |
---|---|---|
committer | Nick Samarin <nicks1987@bigmir.net> | 2010-08-04 23:32:37 +0400 |
commit | a2372308d739879e99423851bc1e1dcd82cf19bf (patch) | |
tree | cc3bb7217585e77f8506f7a030f1f51e8b9c677e /source/gameengine/Ketsji/KX_SteeringActuator.cpp | |
parent | dbc8d4274fa47f429084f653008a14980432a65d (diff) |
integrated adaptive sampling algorithm for obstacle avoidance
Diffstat (limited to 'source/gameengine/Ketsji/KX_SteeringActuator.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_SteeringActuator.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_SteeringActuator.cpp b/source/gameengine/Ketsji/KX_SteeringActuator.cpp index f70826d16f9..e093ddb4072 100644 --- a/source/gameengine/Ketsji/KX_SteeringActuator.cpp +++ b/source/gameengine/Ketsji/KX_SteeringActuator.cpp @@ -254,7 +254,7 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) MT_Vector3 newvel = m_velocity*steervec; //adjust velocity to avoid obstacles - if (m_simulation && m_obstacle && !newvel.fuzzyZero()) + if (m_simulation && m_obstacle /*&& !newvel.fuzzyZero()*/) { if (m_enableVisualization) KX_RasterizerDrawDebugLine(mypos, mypos + newvel, MT_Vector3(1.,0.,0.)); @@ -278,6 +278,15 @@ bool KX_SteeringActuator::Update(double curtime, bool frame) obj->ApplyMovement(movement, false); } } + else + { + if (m_simulation && m_obstacle) + { + m_obstacle->dvel[0] = 0.f; + m_obstacle->dvel[1] = 0.f; + } + + } if (terminate && m_isSelfTerminated) return false; |