mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-11-08 00:45:34 +00:00
add a flag to switch between the reduced deformable and full deformable
This commit is contained in:
@@ -2725,24 +2725,26 @@ void PhysicsServerCommandProcessor::createEmptyDynamicsWorld(int flags)
|
||||
m_data->m_broadphase = bv;
|
||||
}
|
||||
|
||||
#ifndef SKIP_DEFORMABLE_BODY
|
||||
if (flags & RESET_USE_DEFORMABLE_WORLD)
|
||||
{
|
||||
#ifndef SKIP_DEFORMABLE_BODY
|
||||
// deformable
|
||||
// m_data->m_deformablebodySolver = new btDeformableBodySolver();
|
||||
// btDeformableMultiBodyConstraintSolver* solver = new btDeformableMultiBodyConstraintSolver;
|
||||
// m_data->m_solver = solver;
|
||||
// solver->setDeformableSolver(m_data->m_deformablebodySolver);
|
||||
// m_data->m_dynamicsWorld = new btDeformableMultiBodyDynamicsWorld(m_data->m_dispatcher, m_data->m_broadphase, solver, m_data->m_collisionConfiguration, m_data->m_deformablebodySolver);
|
||||
|
||||
m_data->m_deformablebodySolver = new btDeformableBodySolver();
|
||||
btDeformableMultiBodyConstraintSolver* solver = new btDeformableMultiBodyConstraintSolver;
|
||||
m_data->m_solver = solver;
|
||||
solver->setDeformableSolver(m_data->m_deformablebodySolver);
|
||||
m_data->m_dynamicsWorld = new btDeformableMultiBodyDynamicsWorld(m_data->m_dispatcher, m_data->m_broadphase, solver, m_data->m_collisionConfiguration, m_data->m_deformablebodySolver);
|
||||
}
|
||||
else if (flags & RESET_USE_REDUCED_DEFORMABLE_WORLD)
|
||||
{
|
||||
// reduced deformable
|
||||
m_data->m_reducedSoftBodySolver = new btReducedSoftBodySolver();
|
||||
btDeformableMultiBodyConstraintSolver* solver = new btDeformableMultiBodyConstraintSolver;
|
||||
m_data->m_solver = solver;
|
||||
solver->setDeformableSolver(m_data->m_reducedSoftBodySolver);
|
||||
m_data->m_dynamicsWorld = new btDeformableMultiBodyDynamicsWorld(m_data->m_dispatcher, m_data->m_broadphase, solver, m_data->m_collisionConfiguration, m_data->m_reducedSoftBodySolver);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user