I don't see a way to bind my scene node to ndBody like I could in 3.14
- Code: Select all
// save my node as the user data for this body
NewtonBodySetUserData(newtonBody, node.get());
I need to found out which of my nodes are colliding in OnAabbOverlap() as in the demo scenes. Is there a way to do it?
- Code: Select all
bool ndContactCallback::OnAabbOverlap(const ndContact* const contactJoint, ndFloat32 timestep)
{
const ndApplicationMaterial* const material = (ndApplicationMaterial*)contactJoint->GetMaterial();
ndAssert(material);
const ndBodyKinematic* const body0 = contactJoint->GetBody0();
const ndBodyKinematic* const body1 = contactJoint->GetBody1();
const ndShapeInstance& instanceShape0 = body0->GetCollisionShape();
const ndShapeInstance& instanceShape1 = body1->GetCollisionShape();
return material->OnAabbOverlap(contactJoint, timestep, instanceShape0, instanceShape1);
}