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

Wake Physics Body on impulse and apply force. #52967

Merged
merged 1 commit into from
Sep 24, 2021
Merged

Wake Physics Body on impulse and apply force. #52967

merged 1 commit into from
Sep 24, 2021

Conversation

danger-dan
Copy link
Contributor

@danger-dan danger-dan commented Sep 23, 2021

Fixes #52915.

Set active on all apply forces/impulses functions. This wakes sleeping bodies from user input ( E.g. vehicleBody3D). Direct Transform change has been ignored.

note: set_active(bool) function checks against its current 'active' state in the function body.

Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp left a comment

Choose a reason for hiding this comment

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

Looks good! Nice work, thanks.

Please just squash your commits before we merge (see interactive rebase).

Also this fix would be nice to have in 3.4 as well to make Godot physics and Bullet work the same way. If you're up for it, you can open a separate PR on the 3.x branch (it can't be cherry-picked because of file name changes).

@danger-dan
Copy link
Contributor Author

Have squashed into one commit.

@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 24, 2021
@akien-mga akien-mga merged commit fb4fadf into godotengine:master Sep 24, 2021
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@danger-dan danger-dan deleted the dev_vehicle_sleep_fix branch September 24, 2021 10:17
@pouleyKetchoupp
Copy link
Contributor

@danger-dan Congrats! Please let me know whether you would like to take care of backporting to 3.x. It would be the exact same change, but the body direct state methods are in body2d_sw.h and body3d_sw.h instead of being in their own file on that branch.

@danger-dan
Copy link
Contributor Author

@danger-dan Congrats! Please let me know whether you would like to take care of backporting to 3.x. It would be the exact same change, but the body direct state methods are in body2d_sw.h and body3d_sw.h instead of being in their own file on that branch.

Sorry for late reply. Yes I can manage that. I started looking through yesterday and didn't realise they were in the header!

@Calinou Calinou removed cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:2d topic:3d labels Sep 27, 2021
pouleyKetchoupp added a commit that referenced this pull request Oct 5, 2021
Use wakeup() function to wake sleeping bodies on impulse, force and velocities. Fix for PR #52967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VehicleBody3D Doesn't wakeup on Engine Force, Brake or Steering.
4 participants