jcornaz / heron

[DISCONTINUED] An ergonomic physics API for bevy games
MIT License
292 stars 44 forks source link

feat: add `is_lock` and `is_allow` methods to `RotationConstraints` #296

Closed LiamGallagher737 closed 2 years ago

LiamGallagher737 commented 2 years ago

For the record, would you mind share why you needed this?

When doing the following in update the entity wouldn't move

if input.handbrake {
    *rotation_constraints = RotationConstraints::lock();
} else {
    *rotation_constraints = RotationConstraints::allow();
}

But this would

if input.handbrake && rotation_constraints.allow_x && rotation_constraints.allow_y && rotation_constraints.allow_z {
    *rotation_constraints = RotationConstraints::lock();
} else if !input.handbrake && !rotation_constraints.allow_x && !rotation_constraints.allow_y && !rotation_constraints.allow_z {
    *rotation_constraints = RotationConstraints::lock();
}
github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 4.0.0-alpha.2 :tada:

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 4.0.0 :tada: