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

Don't overwrite Time<Physics> when PhysicsPlugins are added #276

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

johanhelsing
Copy link
Contributor

@johanhelsing johanhelsing commented Dec 7, 2023

Objective

insert_resource always overwrites the existing resource, so if you insert your own physics time. e.g. for fixed timestep before adding PhysicsPlugins, you would still get non-fixed time.

Solution

init_resource only adds the resource if it isn't already added, using the default constructor, which should otherwise have the same behavior as before.

insert_resource always overwrites the existing resource, so if you
insert your own physics time. e.g. for fixed timestep before adding
PhysicsPlugins, you would still get non-fixed time.

init_resource only adds the resource if it isn't already added, using
the default constructor, which should otherwise have the same behavior
as before (use defaults which redirects to
`Time::new_with(Physics::default)`)
@Jondolf Jondolf merged commit fd239b9 into Jondolf:main Dec 7, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants