format files

This commit is contained in:
Chuyuan Kelly Fu
2022-03-03 18:11:58 -08:00
parent c9fe6638f8
commit cf185a2d53
5 changed files with 19 additions and 17 deletions

View File

@@ -8134,11 +8134,11 @@ bool PhysicsServerCommandProcessor::processRequestDeformableDeformableContactpoi
{
return false;
}
const int max_contacts_per_object = 4;
for (int i = deformWorld->getSoftBodyArray().size() - 1; i >= 0; i--)
const int max_contacts_per_object = 4;
for (int i = deformWorld->getSoftBodyArray().size() - 1; i >= 0; i--)
{
int num_contacts_reported = 0;
btSoftBody* psb = deformWorld->getSoftBodyArray()[i];
int num_contacts_reported = 0;
btSoftBody* psb = deformWorld->getSoftBodyArray()[i];
for (int c = 0; c < psb->m_faceNodeContacts.size(); c++)
{
const btSoftBody::DeformableFaceNodeContact* contact = &psb->m_faceNodeContacts[c];
@@ -8156,14 +8156,15 @@ bool PhysicsServerCommandProcessor::processRequestDeformableDeformableContactpoi
if(RequestFiltered(clientCmd, linkIndexA, linkIndexB, objectIndexA, objectIndexB, swap)==true){
continue;
}
if(++num_contacts_reported>max_contacts_per_object){
break;
}
//Convert contact info
if (++num_contacts_reported > max_contacts_per_object)
{
break;
}
//Convert contact info
b3ContactPointData pt;
btVector3 l = contact->m_node->m_x - BaryEval(contact->m_face->m_n[0]->m_x, contact->m_face->m_n[1]->m_x, contact->m_face->m_n[2]->m_x, contact->m_normal);
pt.m_contactDistance = -contact->m_margin + contact->m_normal.dot(l);
pt.m_bodyUniqueIdA = objectIndexA;
btVector3 l = contact->m_node->m_x - BaryEval(contact->m_face->m_n[0]->m_x, contact->m_face->m_n[1]->m_x, contact->m_face->m_n[2]->m_x, contact->m_normal);
pt.m_contactDistance = -contact->m_margin + contact->m_normal.dot(l);
pt.m_bodyUniqueIdA = objectIndexA;
pt.m_bodyUniqueIdB = objectIndexB;
pt.m_contactDistance = 0;
pt.m_contactFlags = 0;