-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[Merged by Bors] - documentation on Transform and GlobalTransform #1687
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
Conversation
cart
left a comment
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.
Thanks for putting this together so quickly!
| Self::from_translation(Vec3::new(x, y, z)) | ||
| } | ||
|
|
||
| /// Crate a new identity [`Transform`], with no translation, rotation, and a scale of 1 on |
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.
nit: creates
| } | ||
|
|
||
| /// Crate a new identity [`Transform`], with no translation, rotation, and a scale of 1 on | ||
| /// all axis. |
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.
nit: axes
| } | ||
| } | ||
|
|
||
| /// Extracts the translation, rotation and scale from `matrix`. It must be a 3d affine |
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.
nit: i like the oxford comma ("translation, rotation, and scale")
| } | ||
|
|
||
| /// Create a new [`Transform`], with `translation`. Rotation will be 0 and scale 1 on | ||
| /// all axis. |
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.
nit: axes
| /// Returns transform with the same translation and scale, but rotation so that | ||
| /// transform.forward() points at target | ||
| /// Update and return this [`Transform`] by rotating it so that its unit vector in the | ||
| /// local x direction is toward `target` and its unit vector in the local y direction |
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.
"unit vector in the local x direction is toward target" should be "local z direction"
| self | ||
| } | ||
|
|
||
| /// Returns the 3d affine transformation matrix from this transform translation, |
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.
nit: "this transform's translation"
| value | ||
| } | ||
|
|
||
| /// Change the `scale` of this [`Transform`]. |
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.
We should probably be more clear that this multiplies the current scale by the given scale.
| self.scale *= scale; | ||
| } | ||
|
|
||
| /// Rotate this [`Transform`] so that its unit vector in the local x direction is toward |
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 should also be "local z direction"
|
CI error is probably due to a new rust lint in nightly in |
|
Fixing now. |
|
Fixed in #1690. Kind of weird that this appears to be a statically dispatched method (no instance used), but it still requires the dyn annotation (because it is inside a dyn impl block). |
|
bors r+ |
fixes #1599 * Added doc on `Transform` and `GlobalTransform` to describe usage and how `GlobalTransform` is updated * Documented all methods on `Transform` * `#[doc(hidden)]` most constructors and methods mutating `GlobalTransform`, documented the other * Mentioned z-ordering for `Transform` in 2d
|
Pull request successfully merged into main. Build succeeded: |
fixes #1599
TransformandGlobalTransformto describe usage and howGlobalTransformis updatedTransform#[doc(hidden)]most constructors and methods mutatingGlobalTransform, documented the otherTransformin 2d