Fix the physics debug drawer lagging a frame behind

This commit is contained in:
scrawl 2015-06-07 17:00:00 +02:00
parent b33fe8fb62
commit 16e080e252
3 changed files with 6 additions and 0 deletions

View file

@ -1175,7 +1175,10 @@ namespace MWPhysics
CProfileManager::Reset();
CProfileManager::Increment_Frame_Counter();
}
void PhysicsSystem::debugDraw()
{
if (mDebugDrawer.get())
mDebugDrawer->step();
}

View file

@ -78,6 +78,7 @@ namespace MWPhysics
bool toggleCollisionMode();
void stepSimulation(float dt);
void debugDraw();
std::vector<MWWorld::Ptr> getCollisions(const MWWorld::Ptr &ptr, int collisionGroup, int collisionMask); ///< get handles this object collides with
osg::Vec3f traceDown(const MWWorld::Ptr &ptr, float maxHeight);

View file

@ -1392,6 +1392,8 @@ namespace MWWorld
}
if(player != results.end())
moveObjectImp(player->first, player->second.x(), player->second.y(), player->second.z());
mPhysics->debugDraw();
}
bool World::castRay (float x1, float y1, float z1, float x2, float y2, float z2)