mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-06-08 08:13:55 +00:00
format files
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -411,7 +411,7 @@ void btDeformableBodySolver::predictMotion(btScalar solverdt)
|
||||
psb->m_nodeRigidContacts.resize(0);
|
||||
psb->m_faceRigidContacts.resize(0);
|
||||
psb->m_faceNodeContacts.resize(0);
|
||||
psb->m_faceNodeContactsCCD.resize(0);
|
||||
psb->m_faceNodeContactsCCD.resize(0);
|
||||
// predict motion for collision detection
|
||||
predictDeformableMotion(psb, solverdt);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ void btDeformableMultiBodyDynamicsWorld::performGeometricCollisions(btScalar tim
|
||||
if (psb->isActive())
|
||||
{
|
||||
// clear contact points in the previous iteration
|
||||
psb->m_faceNodeContactsCCD.clear();
|
||||
psb->m_faceNodeContactsCCD.clear();
|
||||
|
||||
// update m_q and normals for CCD calculation
|
||||
for (int j = 0; j < psb->m_nodes.size(); ++j)
|
||||
@@ -237,7 +237,8 @@ void btDeformableMultiBodyDynamicsWorld::performGeometricCollisions(btScalar tim
|
||||
btSoftBody* psb = m_softBodies[i];
|
||||
if (psb->isActive())
|
||||
{
|
||||
penetration_count += psb->m_faceNodeContactsCCD.size();;
|
||||
penetration_count += psb->m_faceNodeContactsCCD.size();
|
||||
;
|
||||
}
|
||||
}
|
||||
if (penetration_count == 0)
|
||||
|
||||
@@ -824,7 +824,7 @@ public:
|
||||
btAlignedObjectArray<DeformableNodeRigidContact> m_nodeRigidContacts;
|
||||
btAlignedObjectArray<DeformableFaceNodeContact> m_faceNodeContacts;
|
||||
btAlignedObjectArray<DeformableFaceRigidContact> m_faceRigidContacts;
|
||||
btAlignedObjectArray<DeformableFaceNodeContact> m_faceNodeContactsCCD;
|
||||
btAlignedObjectArray<DeformableFaceNodeContact> m_faceNodeContactsCCD;
|
||||
tSContactArray m_scontacts; // Soft contacts
|
||||
tJointArray m_joints; // Joints
|
||||
tMaterialArray m_materials; // Materials
|
||||
|
||||
@@ -2053,7 +2053,7 @@ struct btSoftColliders
|
||||
c.m_imf = 0;
|
||||
c.m_c0 = 0;
|
||||
c.m_colObj = psb[1];
|
||||
psb[0]->m_faceNodeContactsCCD.push_back(c);
|
||||
psb[0]->m_faceNodeContactsCCD.push_back(c);
|
||||
}
|
||||
}
|
||||
void Process(const btDbvntNode* lface1,
|
||||
@@ -2118,7 +2118,7 @@ struct btSoftColliders
|
||||
c.m_imf = 0;
|
||||
c.m_c0 = 0;
|
||||
c.m_colObj = psb[1];
|
||||
psb[0]->m_faceNodeContactsCCD.push_back(c);
|
||||
psb[0]->m_faceNodeContactsCCD.push_back(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user