Skip to content

Implement dominance groups - #122

Merged
sebcrozet merged 2 commits into
masterfrom
dominance
Feb 25, 2021
Merged

Implement dominance groups#122
sebcrozet merged 2 commits into
masterfrom
dominance

Conversation

@sebcrozet

@sebcrozet sebcrozet commented Feb 24, 2021

Copy link
Copy Markdown
Member

This PR adds the support for dominance groups. Each rigid-body is part of a dominance group in [-127; 127] (the default is 0). If two rigid-body are in contact, the one with the highest dominance will act as if it has an infinite mass, making it immune to the forces the other body would apply on it.

For example, if a dynamic body A is in the dominance group 10, and a dynamic body B in the dominance group -20, then a contact between A and B will result in A remaining immobile and B being pushed by A.

If both bodies are part of the same dominance group, then their contacts will work in the usual way (both are affected by opposite forces with the same magnitude).

A non-dynamic rigid-body is always considered as being part of a dominance group greater than any dynamic rigid-body. This means that dynamic/static and dynamic/kinematic contacts will continue to work normally, independently from the dominance group they were given by the user.

Dominance is a completely non-realistic feature. But it can be used to simulate specific effects in games. For example, a player represented as a dynamic rigid-body that cannot be "pushed back" by any, or some, other dynamic rigid-bodies part of the environment.

@sebcrozet
sebcrozet merged commit f41a6fb into master Feb 25, 2021
@sebcrozet
sebcrozet deleted the dominance branch February 25, 2021 14:38
jamespohalloran pushed a commit to jamespohalloran/rapier that referenced this pull request Apr 26, 2025
Ensure that the iteration orders remain the same after deserialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant