photo

Is there a way to get the name of the colliding body?

Recommended Posts

I have gotten colliding bodies working for fracturing, but I have been unable to find a way to get the name of the colliding body to limit the fractures to only occur when the colliding body has a specific name. Is there a way to get the colliding a body's name? (or alternatively is there a way to apply masks to callback?)

Share this post


Link to post

Hi AttackGorilla,

If you want to get the node's name you can use something like this:

void contact_callback(BodyPtr body, int num)
{
   const char *node_name = body->getContactBody1()->getObject()->getName();
}

Best regards,
Alexander

Share this post


Link to post