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

Use Transform instead of Position and Rotation in examples #201

Merged
merged 95 commits into from
Oct 28, 2023

Conversation

Jondolf
Copy link
Owner

@Jondolf Jondolf commented Oct 27, 2023

Objective

Using Transform instead of the separate Position and Rotation components is more idiomatic and familiar for Bevy users, but currently the examples use the separate components. This also adds a lot of usage of feature-dependent math types like Vector, which can be a bit more confusing.

Solution

Use Transform in all examples except where Position should be used for stability (in systems that run in the SubstepSchedule).

It now wakes up bodies and subtracts from their mass properties.

Since we can't access components of despawned entities, I added
a `ColliderStorageMap` for now.

It might not be optimal, but it can be improved later.
Ideally we'd use hooks/callbacks once they're implemented in Bevy.
@Jondolf Jondolf added C-Enhancement New feature or request C-Examples Improvements or additions to examples labels Oct 27, 2023
@Jondolf Jondolf merged commit d1d8e71 into main Oct 28, 2023
@Jondolf Jondolf deleted the transform-in-docs-and-examples branch October 28, 2023 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Enhancement New feature or request C-Examples Improvements or additions to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant