Closed bcolloran closed 3 months ago
By changing only the line 75, you are changing the solver group of the dynamic bodies, but the floor still have the default solver group (which is compatible with every other group). So you will loose force computation between the green and blue dynamic bodies, but not between the dynamic bodies in the floor.
To achieve the desired effect you would have to change collision_groups
to solver_groups
on both the static and dynamic objects.
Please reopen if you still have issues with the suggested solution.
The docs on collision and solver groups say:
"solver_groups is here to prevent contact forces from being computed between some colliders, whereas the collision_groups will also prevent the contact themselves (and contact events) from being computed"
Based on the docs, I would expect that if I successfully create a set of
InteractionGroups
that disable collisions altogether usingcollision_groups(...)
, that I should be able to disable the physics calculations without disabling the collision detection by replacingcollision_groups(...)
withsolver_groups(...)
. However, this does not work, as you can see if you attempt it in this example:https://github.com/dimforge/rapier/blob/master/examples2d/collision_groups2.rs
Namely, if you replace line 75 of that file:
with this:
In the unmodified example, the green and blue objects are in different
collision_groups
, so they simply never collide, and the green boxes fall through the blue platform.Likewise, when you make the modification described above, since the green and blue objects are in different
solver_groups
, I expect that they should not compute and apply forces between the green and blue objects, and that the green boxes should once again fall through the blue platform. However, this is not the case: the green boxes come to rest on top of the blue platform, so it's clear that the solver_group is not disabling the computation of forces between these groups.