mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-22 10:39:40 +00:00
Fix the physics debug drawer lagging a frame behind
This commit is contained in:
parent
b33fe8fb62
commit
16e080e252
3 changed files with 6 additions and 0 deletions
|
@ -1175,7 +1175,10 @@ namespace MWPhysics
|
||||||
|
|
||||||
CProfileManager::Reset();
|
CProfileManager::Reset();
|
||||||
CProfileManager::Increment_Frame_Counter();
|
CProfileManager::Increment_Frame_Counter();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PhysicsSystem::debugDraw()
|
||||||
|
{
|
||||||
if (mDebugDrawer.get())
|
if (mDebugDrawer.get())
|
||||||
mDebugDrawer->step();
|
mDebugDrawer->step();
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,7 @@ namespace MWPhysics
|
||||||
bool toggleCollisionMode();
|
bool toggleCollisionMode();
|
||||||
|
|
||||||
void stepSimulation(float dt);
|
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
|
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);
|
osg::Vec3f traceDown(const MWWorld::Ptr &ptr, float maxHeight);
|
||||||
|
|
|
@ -1392,6 +1392,8 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
if(player != results.end())
|
if(player != results.end())
|
||||||
moveObjectImp(player->first, player->second.x(), player->second.y(), player->second.z());
|
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)
|
bool World::castRay (float x1, float y1, float z1, float x2, float y2, float z2)
|
||||||
|
|
Loading…
Reference in a new issue