coal-library / coal

An extension of the Flexible Collision Library
Other
328 stars 93 forks source link

unregisterObject and registerObject with broadphase collision manager #626

Closed molg-karan closed 4 days ago

molg-karan commented 5 days ago

This sits in the real of fcl

I am trying to unregister an collision object by calling unregisterObject on the broadphase manager with which the object is currently registered and then I am registering it with another broadphase collision manager.

The reason is because the grouping of the object has changed and so since now it belongs to the new group, I want to check if it is in collision with the previous group it was a part of.

When I call unregisterObject, the object does get removed from the original group but somehow the call to registerObject doesnt seem to do anything because the collision check after that does not return it as a collision Even though, if I explicitly check using collide function, the object is in collision

Is there any special method that needs to be called after unregistering or registering objects with broadphase manager?

molg-karan commented 4 days ago

need to call update() on the broadphase manager after calling setTransform and computeAABB on the collision object once you update the transform