From 2ec9270b34fe3dac65effeae7ba649957cda19d7 Mon Sep 17 00:00:00 2001 From: Leif Gruenwoldt Date: Fri, 1 May 2015 13:48:48 -0400 Subject: [PATCH] reset agent desired velocity in resetMoveTarget Otherwise, if velocity was non zero at time resetMoveTarget is called the agent would continue to move indefinitely at that velocity (a straight line) which was not the intended behaviour. As discussed in https://groups.google.com/forum/#!topic/recastnavigation/QoLNGz5o6e8 --- DetourCrowd/Source/DetourCrowd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/DetourCrowd/Source/DetourCrowd.cpp b/DetourCrowd/Source/DetourCrowd.cpp index 0bd9e28..f9f4360 100644 --- a/DetourCrowd/Source/DetourCrowd.cpp +++ b/DetourCrowd/Source/DetourCrowd.cpp @@ -653,6 +653,7 @@ bool dtCrowd::resetMoveTarget(const int idx) // Initialize request. ag->targetRef = 0; dtVset(ag->targetPos, 0,0,0); + dtVset(ag->dvel, 0,0,0); ag->targetPathqRef = DT_PATHQ_INVALID; ag->targetReplan = false; ag->targetState = DT_CROWDAGENT_TARGET_NONE;