cgmath icon indicating copy to clipboard operation
cgmath copied to clipboard

Add Transform::{look_at_rh, look_at_lh} and deprecate look_at (continued)

Open elrnv opened this issue 5 years ago • 3 comments

This is a continuation of #508 with the following additions:

  • _lh and _rh suffixes are explained in each affected function.
  • look_at is renamed to look_to on Matrix2 and 2D rotations for consistency.
  • Other uses of look_at were changed to look_to as necessary in the Rotation trait.
  • Remove internal usage of deprecated functions.

These changes make look_at and look_to functions consistent in meaning throughout the crate (with exception of deprecated functions).

elrnv avatar Aug 11 '20 00:08 elrnv

Could somebody sum up the status of this PR? Is there a consensus, and what's left to do?

kvark avatar Nov 23 '20 16:11 kvark

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.

#508 leaves the 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.

elrnv avatar Nov 23 '20 18:11 elrnv