Fixed findStraightPath() to return partial results. Fixed main.cpp FPS throttling. Added initial support for path replanning in DetourCrowd.

This commit is contained in:
Mikko Mononen
2011-08-01 10:48:56 +00:00
parent 2c9a3a0b4f
commit 1b6ca5a94a
17 changed files with 608 additions and 143 deletions

View File

@@ -423,10 +423,10 @@ int main(int /*argc*/, char** /*argv*/)
}
// Clamp the framerate so that we do not hog all the CPU.
const float FRAME_RATE = 40;
if (dt < FRAME_RATE)
const float MIN_FRAME_TIME = 1.0f/40.0f;
if (dt < MIN_FRAME_TIME)
{
int ms = (int)((FRAME_RATE - dt)*1000.0f);
int ms = (int)((MIN_FRAME_TIME - dt)*1000.0f);
if (ms > 10) ms = 10;
if (ms >= 0)
SDL_Delay(ms);