diff --git a/examples/RobotSimulator/RobotSimulatorMain.cpp b/examples/RobotSimulator/RobotSimulatorMain.cpp index ab5d78993..3e2dcd581 100644 --- a/examples/RobotSimulator/RobotSimulatorMain.cpp +++ b/examples/RobotSimulator/RobotSimulatorMain.cpp @@ -28,7 +28,8 @@ int main(int argc, char* argv[]) return -1; } - sim->resetSimulation(RESET_USE_DEFORMABLE_WORLD); + // sim->resetSimulation(RESET_USE_DEFORMABLE_WORLD); + sim->resetSimulation(RESET_USE_REDUCED_DEFORMABLE_WORLD); //Can also use eCONNECT_DIRECT,eCONNECT_SHARED_MEMORY,eCONNECT_UDP,eCONNECT_TCP, for example: //sim->connect(eCONNECT_UDP, "localhost", 1234); @@ -54,8 +55,8 @@ int main(int argc, char* argv[]) sim->loadURDF("plane.urdf"); { - // int deformableUID = sim->loadURDF("reduced_cube/reduced_cube.urdf"); - int deformableUID = sim->loadURDF("reduced_cube/deform_cube.urdf"); + int deformableUID = sim->loadURDF("reduced_cube/reduced_cube.urdf"); + // int deformableUID = sim->loadURDF("reduced_cube/deform_cube.urdf"); // int deformableUID = sim->loadURDF("reduced_torus/reduced_torus.urdf"); // int deformableUID = sim->loadURDF("torus_deform.urdf"); btVector3 basePosition = btVector3(0, 0, 2); diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 2d2b20117..d9748c553 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -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 diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h index 2649fc44d..aab74a3ea 100644 --- a/examples/SharedMemory/SharedMemoryPublic.h +++ b/examples/SharedMemory/SharedMemoryPublic.h @@ -617,6 +617,7 @@ enum b3ResetSimulationFlags RESET_USE_DEFORMABLE_WORLD=1, RESET_USE_DISCRETE_DYNAMICS_WORLD=2, RESET_USE_SIMPLE_BROADPHASE=4, + RESET_USE_REDUCED_DEFORMABLE_WORLD=8, }; struct b3BodyNotificationArgs