ho yes just saw the difference.
so even if I have a NewtonBodyGetFirstContactJoint
I could have no contac in NewtonContactJointGetFirstContact ?
will try that
Moderators: Sascha Willems, Thomas
arkeon wrote:Ok thanks, so contacts joint are only detected by AABB detection ?
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);
}
}
}
}
Users browsing this forum: No registered users and 13 guests