You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IQuick143 opened this issue
Jul 14, 2024
· 1 comment
· Fixed by #14307
Labels
A-MathFundamental domain-agnostic mathematical operationsC-DocsAn addition or correction to our documentationD-TrivialNice and easy! A great choice to get started with Bevy
/// Get the rotation that rotates the X-axis to this direction.
#[inline]
pubfnrotation_from_x(self) -> Rot2{
Rot2::from_sin_cos(self.0.y,self.0.x)
}
/// Get the rotation that rotates this direction to the X-axis.
#[inline]
pubfnrotation_to_x(self) -> Rot2{
// (This is cheap, it just negates one component.)
self.rotation_from_x().inverse()
}
/// Get the rotation that rotates this direction to the Y-axis.
#[inline]
pubfnrotation_from_y(self) -> Rot2{
// `x <- y`, `y <- -x` correspond to rotating clockwise by pi/2;
// this transforms the Y-axis into the X-axis, maintaining the relative position
// of our direction. Then we just use the same technique as `rotation_from_x`.
Rot2::from_sin_cos(-self.0.x,self.0.y)
}
/// Get the rotation that rotates the Y-axis to this direction.
#[inline]
pubfnrotation_to_y(self) -> Rot2{
self.rotation_from_y().inverse()
}
/// Get the rotation that rotates this direction to the Y-axis.#[inline]pubfn rotation_from_y(self) -> Rot2{
This docstring is imho completely backwards to what it should say, notably, it is backwards to what the docstring for rotation_from_x says.
Solution
Figure out which way the methods actually go, and update the docstrings appropriately. (Imo the semantics on the x-axis functions are correct, and the doc strings on the y-axis functions are wrong.)
The text was updated successfully, but these errors were encountered:
A-MathFundamental domain-agnostic mathematical operationsC-DocsAn addition or correction to our documentationD-TrivialNice and easy! A great choice to get started with Bevy
How can Bevy's documentation be improved?
bevy/crates/bevy_math/src/direction.rs
Lines 219 to 245 in d708036
This docstring is imho completely backwards to what it should say, notably, it is backwards to what the docstring for
rotation_from_x
says.Solution
Figure out which way the methods actually go, and update the docstrings appropriately. (Imo the semantics on the x-axis functions are correct, and the doc strings on the y-axis functions are wrong.)
The text was updated successfully, but these errors were encountered: