Open elrnv opened 4 years ago
Could somebody sum up the status of this PR? Is there a consensus, and what's left to do?
IIRC this PR aims to get consistent naming for _to
and _at
variants of the look_
functions on top of #508.
It does this to a certain extent without committing to major changes to the Rotation
and Transform
APIs. In particular, this PR changes look_at
to look_to
in Rotation
without the _lh
or _rh
suffixes for now in hopes of properly resolving the overlap between the Rotation
and Transform
APIs in another PR since I don't have the time at the moment to dwell on this. The remaining decision I think is whether to roll back the changes to the Rotation
trait or keep it as is since it has better consistency for the time being, and it's not clear that the next PR will come any time soon.
The other point to resolve is whether Matrix2 needs _lh
and _rh
variants for the look_to
function. In my opinion it does not, but I am more than happy to either revert that change or do something else there.
look_to
and look_at
function variants in an inconsistent state to (I think) avoid breaking the APIs of things like Rotation and Matrix2 temporarily before a more appropriate solution is found. Given the cadence of this crate, I think the changes in this PR are appropriate to get some consistency albeit not necessarily with respect to _lh
and _rh
variants of the look_
functions.I believe the current implementation of look_at/to
in Matrix2 is suited for 2d spritework, where in order for a sprite to maintain an "upwards" orientation while looking in the opposite direction, it must mirror itself. It is a related, but different operation than in the Matrix3 and Matrix4 implementations. Even with that in mind, I would still favor renaming it to look_to
instead of look_at
.
This is a continuation of #508 with the following additions:
_lh
and_rh
suffixes are explained in each affected function.look_at
is renamed tolook_to
on Matrix2 and 2D rotations for consistency.look_at
were changed tolook_to
as necessary in theRotation
trait.These changes make
look_at
andlook_to
functions consistent in meaning throughout the crate (with exception of deprecated functions).