- This topic has 2 replies, 2 voices, and was last updated 9 years, 5 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] Turning off collisions between a set of objects?
Dear Sofa users,
If I have 3 objects, say , A,B and C, can I disable collisions between A and B, while C can still interact normally with both A and B?
I’ve seen RuleBasedContactManager but I dont know exactly how to use it.
Best regards
Hello,
The problem you describe is simple enough that you do not need a RuleBasedContactManager.
A collision occurs between two objects when they do not have any collision group in common. So we can set the objects as follow:
A: group=”1″, B: group=”1″, C: group=”2″
A and B are in the same group, they will not interact, but C is in another and will interact with both of them.
Now for an explanation of the RuleBasedContactManager in case you ever need it.
This component allows to choose the collision response for each possible collision in your simulation. Let us reuse your example with the 3 objects, and set their group as A=1, B=2, C=3.
In the RuleBasedContactManager we now have to define rules that will set the collision response for a contact based on the collision groups of the objects that interact. A rule is defined as follows: “group1 group2 response”. It is possible to use wildcards (*) to match all groups, and we can set the response params after the character ‘?’. The rules are tested in the order they are written, the first that matches the groups is chosen. An example:
<RuleBasedContactManager rules="1 2 null 1 3 FrictionContact 3 * FrictionContact?mu=0.1" />
There we have said that collisions between A and B are deactivated, we ask for a contact with friction between A and C, and all other contacts with C will have a lower friction coefficient.
Best regards,
Christophe Guébert
Digital Trainers
Thanks, It works!
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.