add option to turn self-collision on/off

This commit is contained in:
Xuchen Han
2019-10-04 17:53:53 -07:00
committed by Xuchen Han
parent 4220c7f94c
commit e13578fee3
6 changed files with 44 additions and 10 deletions

View File

@@ -8144,6 +8144,12 @@ bool PhysicsServerCommandProcessor::processLoadSoftBodyCommand(const struct Shar
psb->m_cfg.collisions |= btSoftBody::fCollision::VF_DD;
psb->setCollisionFlags(0);
psb->setTotalMass(mass);
bool use_self_collision = false;
if (clientCmd.m_updateFlags & LOAD_SOFT_BODY_USE_SELF_COLLISION)
{
use_self_collision = loadSoftBodyArgs.m_useSelfCollision;
}
psb->setSelfCollision(use_self_collision);
#else
btSoftBody::Material* pm = psb->appendMaterial();
pm->m_kLST = 0.5;