for my game i am trying to implement a method wich will be called in the game loop to calculate the physics. the time elapsed is required. for some reason which is unknown to me i keep getting and unhandeled exception? what is wrong with the code?
void PhysicsManager::StepPhysics()
{
// Get frame delta time: NOT WORKING
const u32 time_now = device->getTimer()->getTime();
const f32 frameDeltaTime = (f32)(time_now-time_then)/1000.f; // Time in seconds: /1000.f
time_then = time_now;
// Set the physics simulation going
physxManager->simulate(TimeElapsed);
// Wait for the physics simulation to finish
physxManager->fetchResults();
// Render Physx debug data
physxManager->renderDebugData(video::SColor(225,255,255,255));
}
time_then is defined elsewhere as the time from when the program began