mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-08-10 23:39:32 +00:00
Merge pull request #2826 from xhan0619/grav-factor
Deformable gravity factor
This commit is contained in:
@@ -8428,7 +8428,10 @@ void constructUrdfDeformable(const struct SharedMemoryCommand& clientCmd, UrdfDe
|
||||
{
|
||||
deformable.m_repulsionStiffness = loadSoftBodyArgs.m_repulsionStiffness;
|
||||
}
|
||||
|
||||
if (clientCmd.m_updateFlags & LOAD_SOFT_BODY_SET_GRAVITY_FACTOR)
|
||||
{
|
||||
deformable.m_gravFactor = loadSoftBodyArgs.m_gravFactor;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -8641,14 +8644,17 @@ bool PhysicsServerCommandProcessor::processDeformable(const UrdfDeformable& defo
|
||||
// turn on the collision flag for deformable
|
||||
// collision between deformable and rigid
|
||||
psb->m_cfg.collisions = btSoftBody::fCollision::SDF_RD;
|
||||
// turn on face contact only for multibodies
|
||||
// turn on face contact for multibodies
|
||||
psb->m_cfg.collisions |= btSoftBody::fCollision::SDF_MDF;
|
||||
/// turn on face contact for rigid body
|
||||
psb->m_cfg.collisions |= btSoftBody::fCollision::SDF_RDF;
|
||||
// collion between deformable and deformable and self-collision
|
||||
psb->m_cfg.collisions |= btSoftBody::fCollision::VF_DD;
|
||||
psb->setCollisionFlags(0);
|
||||
psb->setTotalMass(deformable.m_mass);
|
||||
psb->setSelfCollision(useSelfCollision);
|
||||
psb->setSpringStiffness(deformable.m_repulsionStiffness);
|
||||
psb->setGravityFactor(deformable.m_gravFactor);
|
||||
psb->initializeFaceTree();
|
||||
}
|
||||
#endif //SKIP_DEFORMABLE_BODY
|
||||
|
||||
Reference in New Issue
Block a user