Enable specifying extra margins for objects in DynamicAABBTreeArray broadphase manager.#802
Enable specifying extra margins for objects in DynamicAABBTreeArray broadphase manager.#802torresl-google wants to merge 1 commit intocoal-library:develfrom
Conversation
|
Hi @torresl-google ! You're right that the broadphase managers in coal don't deal with the security margin of the various narrowphases by default. For reference, here is how we deal with it in pinocchio: see here, inside the You could do something similar in your application:
Getting back to Coal: I think the value of the broadphase managers in Coal is the implementation of various methods that construct the different data structures and run the broadphase, given a set of objects and their AABBs. Coal proposes default callbacks, but it is quite flexible to suit various specific needs (again, cf pinocchio). TLDR: I would suggest users to inherit from coal's broadphase manager (to benefit from the core algorithms) and implement their own callback in their application. I am not convinced it's the job of coal to handle specific use cases. @torresl-google what do you think? Am I missing something? |
|
Thanks for the thoughtful response, @lmontaut! I had not thought of using inheritance to implement my own broadphase manager with margin awareness. I do have one concern about the solution you proposed from Pinocchio: in that update function, the Does the above sound correct? This is why I chose to store the margin-expanded AABBs separately in the broadphase manager without modifying the I tried to implement a margin-aware broadphase manager that inherits from |
|
Hey @torresl-google! Can I ask which signature of Short version: I think I understand the confusion: you are refering to an
More details: The broadphase manager's The narrowphase runs directly on the objects' geometries. The narrowphase does not look at their AABBs. The signature of Does this make sense? I hope I am not missing something, otherwise please let me know! |
|
Thank you, @lmontaut ! Sorry, my question was very unclear but I believe you still answered it! My question was specifically about calling collide(obj1, obj2, request, result) where If I understand you correctly, the above Is the above correct? If so, then I think I can do everything I need by deriving a new class that inherits from |
|
@torresl-google yes this is correct! @torresl-google I'll let you close this PR :) |
Before this change, if a user wanted to do collision checking with a security margin, they couldn't use a broadphase manager because the broadphase may discard pairs of objects whose AABB's do not overlap.
This change allows users to specify margins on CollisionObjects that they add to DynamicAABBTreeArrayCollisionManager. The broadphase will operate on these objects as if they had larger AABBs, but the objects themselves are unchanged.
This change enables the following useful patterns:
collide()queries and catch all collisions within the security margin.I don't consider this PR complete at all! I wanted to use it to start a conversation: