Deformables: enable double sided rendering, reduced the number of debug lines in regular rendering.

This commit is contained in:
Erwin Coumans
2019-11-12 20:08:49 -08:00
parent b25d806b14
commit 9ca957387f
15 changed files with 108 additions and 41 deletions

View File

@@ -378,6 +378,22 @@ void btDeformableMultiBodyDynamicsWorld::reinitialize(btScalar timeStep)
btMultiBodyDynamicsWorld::getSolverInfo().m_timeStep = timeStep;
}
void btDeformableMultiBodyDynamicsWorld::debugDrawWorld()
{
for (int i = 0; i < getSoftBodyArray().size(); i++)
{
btSoftBody* psb = (btSoftBody*)getSoftBodyArray()[i];
{
btSoftBodyHelpers::DrawFrame(psb, getDebugDrawer());
btSoftBodyHelpers::Draw(psb, getDebugDrawer(), getDrawFlags());
}
}
btMultiBodyDynamicsWorld::debugDrawWorld();
}
void btDeformableMultiBodyDynamicsWorld::applyRigidBodyGravity(btScalar timeStep)
{
// Gravity is applied in stepSimulation and then cleared here and then applied here and then cleared here again

View File

@@ -93,7 +93,9 @@ public:
}
virtual int stepSimulation(btScalar timeStep, int maxSubSteps = 1, btScalar fixedTimeStep = btScalar(1.) / btScalar(60.));
virtual void debugDrawWorld();
void setSolverCallback(btSolverCallback cb)
{
m_solverCallback = cb;
@@ -178,6 +180,7 @@ public:
{
m_lineSearch = lineSearch;
}
};
#endif //BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD_H