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

Run parent-update and transform-propagation during the "post-startup" stage (instead of "startup") #955

Merged
merged 2 commits into from
Nov 29, 2020
Merged

Run parent-update and transform-propagation during the "post-startup" stage (instead of "startup") #955

merged 2 commits into from
Nov 29, 2020

Conversation

jcornaz
Copy link
Contributor

@jcornaz jcornaz commented Nov 29, 2020

Hi,

Currently, parent_update_system and transform_propagate_system are registerd to run both at startup and for each update.

When running for ecah update they are in the stage POST_UPDATE. It makes sense, because it make sure they run after potential creation/update of Transform that would happen during the UPDATE stage.

But when running at startup, these two systems were in the default (STARTUP) stage. So if the user spawn entities during that stage (which is very likely, since it's the default), then the entities spawned by the user may have a incorrect GlobalTransform for the first update.

This discrepency looks very much like a small mistake. I assume that, If it is correct to run these two system during the POST_UPDATE of each update, then the correct things to do at startup is to run during the POST_STARTUP.

I hope it makes sense.

Thanks for this awseome work!

@jcornaz jcornaz changed the title Update parents and propagate transforms during the POST_STARTUP start-up stage (instead of STARTUP) Update parents and propagate transforms during the "post-startup" stage (instead of "startup") Nov 29, 2020
@jcornaz jcornaz changed the title Update parents and propagate transforms during the "post-startup" stage (instead of "startup") Update parent-update and transform-propagation during the "post-startup" stage (instead of "startup") Nov 29, 2020
@jcornaz jcornaz changed the title Update parent-update and transform-propagation during the "post-startup" stage (instead of "startup") Run parent-update and transform-propagation during the "post-startup" stage (instead of "startup") Nov 29, 2020
@memoryruins memoryruins added the A-ECS Entities, components, systems, and events label Nov 29, 2020
@cart
Copy link
Member

cart commented Nov 29, 2020

Yup that all makes sense to me. Good catch!

@cart cart merged commit 52d6799 into bevyengine:master Nov 29, 2020
@jcornaz jcornaz deleted the fix-startup-transform-update branch November 30, 2020 07:41
@fopsdev fopsdev mentioned this pull request Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants