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

Support for 3D sync to physics #49328

Merged
merged 1 commit into from
Jul 15, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp commented Jun 5, 2021

Same implementation as in 2D, based on the code from PR #49327.

Closes godotengine/godot-proposals#961.
Fixes #36334

@pouleyKetchoupp
Copy link
Contributor Author

I've just pushed an extra modification in move_and_slide that can help with moving platforms, the same one that's already done in 2D:

Vector2 current_floor_velocity = floor_velocity;
if (on_floor && on_floor_body.is_valid()) {
//this approach makes sure there is less delay between the actual body velocity and the one we saved
PhysicsDirectBodyState2D *bs = PhysicsServer2D::get_singleton()->body_get_direct_state(on_floor_body);
if (bs) {
current_floor_velocity = bs->get_linear_velocity();
}
}

Same implementation as in 2D.
@akien-mga akien-mga merged commit 60add98 into godotengine:master Jul 15, 2021
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants