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

Move Bullet physics query flush from Bullet space pre-tick callback to Bullet physics flush_queries() #40184

Merged
merged 1 commit into from
Jul 10, 2020

Conversation

madmiraal
Copy link
Contributor

@madmiraal madmiraal commented Jul 7, 2020

This is where it's done in Godot physics. It ensures that the queries are flushed before _physics_process() is called; so current values are available within _physics_process().

Fixes #37702.
Fixes #40110.

@aaronfranke
Copy link
Member

The issue says it's 2 frames late. Does this make physics 1 frame late or 0 frames late?

@madmiraal
Copy link
Contributor Author

The issue says it's 2 frames late. Does this make physics 1 frame late or 0 frames late?

It makes it one frame "late", which is expected, as per the issue description:

3d physics stepping is two frames late using bullet physics. Expected would be that it is one frame late.

Basically, the effect of any changes made during the current physics frame should be available in the next frame.

Bullet physics flush_queries() as is done in Godot physics, and remove
the pre-tick callback.
Copy link
Contributor

@AndreaCatania AndreaCatania left a comment

Choose a reason for hiding this comment

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

This looks good, thanks!

@akien-mga akien-mga merged commit fb664c6 into godotengine:master Jul 10, 2020
@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
4 participants