-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CollisionModel] New: added collision layer property #4219
base: master
Are you sure you want to change the base?
[CollisionModel] New: added collision layer property #4219
Conversation
Hey! Can you explain how it is different from the |
Hi, @alxbilger! It works the opposite way the collision groups work. With collision groups, collision can only occur between the models' group sets do not overlap (no common groups). With the collision layers it' s the opposite -- collision can only occur if the models are in the same layer. |
@@ -407,6 +407,9 @@ class SOFA_CORE_API CollisionModel : public virtual objectmodel::BaseObject | |||
/// models included in a common group (i.e. sharing a common id) | |||
Data< std::set<int> > group; | |||
|
|||
// No collision can occur between collision models in different layers | |||
Data<int> layer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data<int> layer; | |
Data<int> d_layer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also needs to be initialized in the constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to define more than one layer for a collision model?
Hi vlad, this PR has also been discussed during the dev meeting. We are also curious to know how you handle differences between this and the group mechanism : what happens if you are in the same time in the same group and in the same layer ? Are the two mechanism really necessary ? And finally, again, some unit testing would be great if we manage to find a mechanism that suites every one. |
This PR introduces collision layers, a collision filtering algorithm similar to the one used in Unity's collsion pipeline. The overall idea is to omit collision detection for models that are in different layers. This way, each layer can be used for different functionality, e.g. cutting simulation.
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if