Clarify Transform and GlobalTransform documentation (adopted) - #15358
Clarify Transform and GlobalTransform documentation (adopted)#15358bas-ie wants to merge 16 commits into
Transform and GlobalTransform documentation (adopted)#15358Conversation
pablo-lua
left a comment
There was a problem hiding this comment.
Looks clear and now populated with useful examples of what to do or how to do. All good.
| use bevy_reflect::{ReflectDeserialize, ReflectSerialize}; | ||
|
|
||
| /// [`GlobalTransform`] is an affine transformation from entity-local coordinates to worldspace coordinates. | ||
| /// Describes the absolute transform (translation, rotation, scale) of an entity in space, |
There was a problem hiding this comment.
The (translation, rotation, scale) part is a bit misleading, since GlobalTransform is not a TRS transformation in general. This also applies to the later part of this doc comment which breaks down translation, rotation, and scale.
There was a problem hiding this comment.
Right, I might see if I can walk that part back a bit.
There was a problem hiding this comment.
Would you mind re-checking, just to see if I've understood you correctly? Cheers!
Co-authored-by: Matty <weatherleymatthew@gmail.com>
|
Could we remove my tagged username from the description so it doesn't end up in a commit message? |
Removed to prevent endless notification spam for both of you. |
Sorry! |
| /// | ||
| /// [`Transform`] is the local transform (translation, rotation, scale) of an entity in space. | ||
| /// If the entity has a parent, the local transform is relative to its parent's | ||
| /// [`GlobalTransform`], otherwise, it's relative to the main reference frame. |
There was a problem hiding this comment.
| /// [`GlobalTransform`], otherwise, it's relative to the main reference frame. | |
| /// [`GlobalTransform`]; otherwise, it's relative to the main reference frame. |
| /// [`Transform`] is the local transform of an entity in space relative to its parent transform, | ||
| /// or the global transform relative to the main reference frame if it doesn't have a [`Parent`]. |
There was a problem hiding this comment.
| /// [`Transform`] is the local transform of an entity in space relative to its parent transform, | |
| /// or the global transform relative to the main reference frame if it doesn't have a [`Parent`]. | |
| /// [`Transform`] is the local transform of an entity in space relative to its parent transform; | |
| /// if it doesn't have a [`Parent`], then it is equivalent to the global transform relative to the main reference frame. |
There was a problem hiding this comment.
I think I'd go with a separate sentence here.
| /// - The `scale` is relative to the parent's [`GlobalTransform`], it is multiplied | ||
| /// by it. |
There was a problem hiding this comment.
| /// - The `scale` is relative to the parent's [`GlobalTransform`], it is multiplied | |
| /// by it. | |
| /// - The `scale` is relative to the parent's [`GlobalTransform`] (it is multiplied in) |
There was a problem hiding this comment.
Hrm, I'm not particularly convinced by either one. Maybe simply,
The
scaleis multiplied by the parent entity's [GlobalTransform].
?
| /// [`Transform`] is the local transform of an entity in space relative to its parent transform, | ||
| /// or the global transform relative to the main reference frame if it doesn't have a [`Parent`]. |
There was a problem hiding this comment.
| /// [`Transform`] is the local transform of an entity in space relative to its parent transform, | |
| /// or the global transform relative to the main reference frame if it doesn't have a [`Parent`]. | |
| /// [`Transform`] is the local transform of an entity in space relative to its parent transform; | |
| /// if it doesn't have a [`Parent`], then it is the global transform relative to the main reference frame. |
There was a problem hiding this comment.
Think I'll add a sentence here too.
| /// [`TransformPropagate`]. | ||
| /// Those systems run during [`PostUpdate`]. | ||
| /// If you update the [`Transform`] of an entity in this schedule or after, | ||
| /// you may notice a 1 frame lag before the [`GlobalTransform`] is updated. |
There was a problem hiding this comment.
| /// you may notice a 1 frame lag before the [`GlobalTransform`] is updated. | |
| /// you may notice 1 frame of lag before the [`GlobalTransform`] is updated. |
There was a problem hiding this comment.
I should update to use "one" 🤔
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
|
Thanks for the review! I've neglected this PR, will try to get back to it today. |
|
This is still desired but needs to be revived |
NOTE: this is adopted from
Selene-Amanita's #9182. I've:rparrett'ssuggestionsOriginal PR description follows. Because it's from last year, it'd be great to get fresh eyes on it to see if it inadvertently removes things we'd like to keep. I also have one question about documentation links, below.