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

Make disabling joints possible. #519

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

shanecelis
Copy link
Contributor

Objective

Make disabling joints possible.

Solution

I added DisableJoint and added the Without<DisableJoint> filter on the query.

Naming

In discord Jondolf had used the name JointDisabled; however, I thought the verb form DisableJoint was my preference. But this is not a strong opinion. If there are other past tense components, then I'm happy to have it either way.

Other Considerations

I added derives for copy, clone, reflect, and serialize but these were added to follow suit rather than for a good reason of my own.

Alternatives

One could set the compliance to a large number. But what large number? And why bother computing when one would prefer disabling?


Changelog

  • Joints can be disabled with the DisableJoint component.

@Jondolf Jondolf added C-Enhancement New feature or request A-Joints Relates to joints constraining the relative positions and orientations of rigid bodies labels Sep 22, 2024
@Jondolf
Copy link
Owner

Jondolf commented Sep 22, 2024

I think in this case, I'd use JointDisabled. It's a marker indicating the state of the joint, and for that, a descriptive word like Disabled might be better than the present tense verb Disable. Using the present verb here would imply to me that it is actively doing something, like queuing the joint to get disabled, rather than just saying "this joint is disabled".

If we're looking for examples of this in Bevy and other ECSs, Flecs has a Disabled tag, and Bevy will likely add one as well (an earlier PR for it is here).

Copy link
Owner

@Jondolf Jondolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Jondolf Jondolf merged commit 68e2ba7 into Jondolf:main Sep 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Joints Relates to joints constraining the relative positions and orientations of rigid bodies C-Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants