NewtonContactsProcess is and NewtonOnAABBOverlap returns 0?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

NewtonContactsProcess is and NewtonOnAABBOverlap returns 0?

Postby pHySiQuE » Sun Jul 14, 2013 4:42 pm

I have a program with a bunch of bodies created near each other. I set NewtonOnAABBOverlap to always return 0, but NewtonContactsProcess is still being called. Is there any circumstances under which this is supposed to happen? If so, can you please explain this? Thank you.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: NewtonContactsProcess is and NewtonOnAABBOverlap returns

Postby Julio Jerez » Mon Jul 15, 2013 7:32 am

no that I know off, if that function return 0 it will never generate a contact joint for these objects
there is only one entry point for generatinf colliding pairs, and here is the code

Code: Select all
void dgCollidingPairCollector::AddPair (dgContact* const contact, dgInt32 threadIndex)
{
   dgWorld* const world = (dgWorld*) this;
   dgBody* const body0 = contact->m_body0;
   dgBody* const body1 = contact->m_body1;
   dgAssert (body0 != m_sentinel);
   dgAssert (body1 != m_sentinel);
   dgAssert (contact->GetId() == dgConstraint::m_contactConstraint);
   dgAssert (body0->GetWorld());
   dgAssert (body1->GetWorld());
   dgAssert (body0->GetWorld() == world);
   dgAssert (body1->GetWorld() == world);
   if (!(body0->m_collideWithLinkedBodies & body1->m_collideWithLinkedBodies)) {
      if (world->AreBodyConnectedByJoints (body0, body1)) {
         return;
      }
   }

   const dgContactMaterial* const material = contact->m_material;
   if (material->m_flags & dgContactMaterial::m_collisionEnable) {
      dgInt32 processContacts = 1;
      if (material->m_aabbOverlap) {
         processContacts = material->m_aabbOverlap (*material, *body0, *body1, threadIndex);
      }
      if (processContacts) {



the only way that the pair can be generated is if the tow bodies have different material and if one of the material interaction does no have a m_aabbOverlap function.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron