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

Add RigidBodyDisabled and ColliderDisabled #436

Closed
janhohenheim opened this issue Jul 17, 2024 · 0 comments · Fixed by #584
Closed

Add RigidBodyDisabled and ColliderDisabled #436

janhohenheim opened this issue Jul 17, 2024 · 0 comments · Fixed by #584
Labels
A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Enhancement New feature or request D-Medium A moderate level of difficulty: suitable for simple features or challenging fixes.

Comments

@janhohenheim
Copy link
Contributor

Needed by @kaosat-dev for nicer Blenvy support.

@Jondolf Jondolf added C-Enhancement New feature or request A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on D-Medium A moderate level of difficulty: suitable for simple features or challenging fixes. labels Jul 19, 2024
Jondolf added a commit that referenced this issue Dec 7, 2024
# Objective

Fixes part of #436.

A pretty common user request is to be able to temporarily disable rigid bodies without removing them from the world. This can be done by removing `RigidBody`, but this loses the type of rigid body, makes queries a bit more annoying, and can involve somewhat expensive clean-up.

In the absence of general-purpose component disabling in Bevy, it would be useful to have a `RigidBodyDisabled` marker that can be used to temporarily remove a body from the simulation.

## Solution

Add a `RigidBodyDisabled` marker component. It disables velocity, forces, contact response, and attached joints. It does *not* disable collision detection or spatial queries for attached colliders however; that should be handled with a separate `ColliderDisabled` component in a follow-up.
@Jondolf Jondolf closed this as completed in 5eb5722 Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Collision Relates to the broad phase, narrow phase, colliders, or other collision functionality A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Enhancement New feature or request D-Medium A moderate level of difficulty: suitable for simple features or challenging fixes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants