Skip to content
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

Implement dominance groups #122

Merged
merged 2 commits into from
Feb 25, 2021
Merged

Implement dominance groups #122

merged 2 commits into from
Feb 25, 2021

Conversation

sebcrozet
Copy link
Member

@sebcrozet sebcrozet commented Feb 24, 2021

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.

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