FindCollidingPairsGeneric inside a collision tree

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: FindCollidingPairsGeneric inside a collision tree

Postby arkeon » Sun Sep 21, 2014 6:48 am

ho yes just saw the difference.

so even if I have a NewtonBodyGetFirstContactJoint
I could have no contac in NewtonContactJointGetFirstContact ?

will try that
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: FindCollidingPairsGeneric inside a collision tree

Postby arkeon » Sun Sep 21, 2014 6:54 am

Yes it works :)
So this was not a bug.

Thanks !
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: FindCollidingPairsGeneric inside a collision tree

Postby manny » Sun Sep 21, 2014 6:55 am

yeah, so the broadphase generated the contact pair but no contact was found in the narrowphase. As i mentioned earlier. :D

EDIT: fixed typo 8)
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: FindCollidingPairsGeneric inside a collision tree

Postby arkeon » Sun Sep 21, 2014 6:56 am

yes contact in the broadphase but not in the narrowphase you mean ;)
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: FindCollidingPairsGeneric inside a collision tree

Postby manny » Sun Sep 21, 2014 6:57 am

yeppers :)
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: FindCollidingPairsGeneric inside a collision tree

Postby Julio Jerez » Sun Sep 21, 2014 7:44 am

arkeon wrote:Ok thanks, so contacts joint are only detected by AABB detection ?

yes this is correct.
contact here meant a ConctactJoint, which is a constraint.

the broadPhase in newton is simple a manager that create and destroy contact joints.
the same way a joint can be disable by simple returning zero in the SubmitConstraint callback, at contact joint can also be disable by returning 0 in its SubmitConstraint callback.

ContaJoint persist as long as the AABB plus some Broaphase Padding overlap,

when iteration ove contact joints with these functions
NewtonBodyGetFirstContactJoint /NewtonContactJointGetFirstContact ?

you must use function NewtonJointIsActive (joint);
to determine is the joint has valid contapoints or not
here is and example from Custom trigger manager
Code: Select all
void CustomTriggerManager::UpdateTrigger (CustomTriggerController* const controller)
{
   NewtonBody* const triggerBody = controller->GetBody();
   dTree<NewtonBody*,NewtonBody*>& manifest = controller->m_manifest;

   for (NewtonJoint* joint = NewtonBodyGetFirstContactJoint (triggerBody); joint; joint = NewtonBodyGetNextContactJoint (triggerBody, joint)) {

      int isActive = NewtonJointIsActive (joint);
      NewtonBody* const body0 = NewtonJointGetBody0(joint);
      NewtonBody* const body1 = NewtonJointGetBody1(joint);
      NewtonBody* const passangerBody = (body0 != triggerBody) ? body0 : body1;
      
      dTree<NewtonBody*,NewtonBody*>::dTreeNode* const passengerNode = manifest.Find (passangerBody);
      if (isActive) {
         if (passengerNode) {
            EventCallback (controller, m_inTrigger, passangerBody);

         } else {
            CustomScopeLock lock (&m_lock);
            manifest.Insert (passangerBody, passangerBody);
            EventCallback (controller, m_enterTrigger, passangerBody);
         }
      } else {
         if (passengerNode) {
            EventCallback (controller, m_exitTrigger, passangerBody);

            CustomScopeLock lock (&m_lock);
            manifest.Remove (passengerNode);
         }
      }
   }
}


having persistent contact joint simply lot of high level algorithm, and also make the engine a lo more efficient.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: FindCollidingPairsGeneric inside a collision tree

Postby arkeon » Sun Sep 21, 2014 7:50 am

Ho ok I though it was NewtonJointGetCollisionState that was doing that.
So with NewtonJointIsActive I don't need to test the first contact in contact joint ?
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: FindCollidingPairsGeneric inside a collision tree

Postby Julio Jerez » Sun Sep 21, 2014 8:02 am

yes, you can look at the debug display funtions in the sandbox, that function is in several place to determine what joint are part of the simulation an which are part of the broaphase

this is also another difference between Newton 3.xx and 2.xx
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: FindCollidingPairsGeneric inside a collision tree

Postby arkeon » Sun Sep 21, 2014 8:02 am

Ok thanks
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Previous

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 2 guests