-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Add TransformBundle #3054
Changes from all commits
b0a0e31
9520632
e0ef281
e861649
e7b8b61
33aa831
fb8c25e
29b23d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,9 @@ use std::ops::Mul; | |
/// to its parent position. | ||
/// | ||
/// * To place or move an entity, you should set its [`Transform`]. | ||
/// * To be displayed, an entity must have both a [`Transform`] and a [`GlobalTransform`]. | ||
/// * To get the global position of an entity, you should get its [`GlobalTransform`]. | ||
/// * To be displayed, an entity must have both a [`Transform`] and a [`GlobalTransform`]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it really "to be displayed", or rather "for anything to work at all"? What happens if either of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other effect will be that parent-child propagation won't work properly. |
||
/// * You may use the [`TransformBundle`](crate::TransformBundle) to guarantee this. | ||
/// | ||
/// ## [`Transform`] and [`GlobalTransform`] | ||
/// | ||
|
@@ -21,16 +22,6 @@ use std::ops::Mul; | |
/// [`GlobalTransform`] is updated from [`Transform`] in the system | ||
/// [`transform_propagate_system`](crate::transform_propagate_system::transform_propagate_system). | ||
/// | ||
/// In pseudo code: | ||
/// ```ignore | ||
/// for entity in entities_without_parent: | ||
/// set entity.global_transform to entity.transform | ||
/// recursively: | ||
/// set parent to current entity | ||
/// for child in parent.children: | ||
/// set child.global_transform to parent.global_transform * child.transform | ||
/// ``` | ||
/// | ||
/// This system runs in stage [`CoreStage::PostUpdate`](crate::CoreStage::PostUpdate). If you | ||
/// update the[`Transform`] of an entity in this stage or after, you will notice a 1 frame lag | ||
/// before the [`GlobalTransform`] is updated. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why is this documentation block being removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This came from this #2331 (comment) part of the previous PR.