From 59b0709fcfffb90ef5f30f2fe3b15ac1d43ea31d Mon Sep 17 00:00:00 2001 From: Gedl Date: Thu, 17 Jan 2019 10:17:00 +0100 Subject: [PATCH] Retain new_observer_frame as a deprecated wrapper function --- src/base/cg.rs | 6 ++++++ src/geometry/isometry_construction.rs | 9 +++++++++ src/geometry/quaternion_construction.rs | 10 ++++++++++ src/geometry/rotation_specialization.rs | 10 ++++++++++ src/geometry/similarity_construction.rs | 10 ++++++++++ 5 files changed, 45 insertions(+) diff --git a/src/base/cg.rs b/src/base/cg.rs index c326e5fb..5883e710 100644 --- a/src/base/cg.rs +++ b/src/base/cg.rs @@ -134,6 +134,12 @@ impl Matrix4 { IsometryMatrix3::face_towards(eye, target, up).to_homogeneous() } + /// Deprecated: Use [Matrix4::face_towards] instead. + #[deprecated(note="renamed to `face_towards`")] + pub fn new_observer_frame(eye: &Point3, target: &Point3, up: &Vector3) -> Self { + Matrix4::face_towards(eye, target, up) + } + /// Builds a right-handed look-at view matrix. #[inline] pub fn look_at_rh(eye: &Point3, target: &Point3, up: &Vector3) -> Self { diff --git a/src/geometry/isometry_construction.rs b/src/geometry/isometry_construction.rs index 976e2d40..b22ed32a 100644 --- a/src/geometry/isometry_construction.rs +++ b/src/geometry/isometry_construction.rs @@ -233,6 +233,15 @@ macro_rules! isometry_construction_impl( $RotId::face_towards(&(target - eye), up)) } + /// Deprecated: Use [Isometry::face_towards] instead. + #[deprecated(note="renamed to `face_towards`")] + pub fn new_observer_frame(eye: &Point3, + target: &Point3, + up: &Vector3) + -> Self { + Self::face_towards(eye, target, up) + } + /// Builds a right-handed look-at view matrix. /// /// It maps the view direction `target - eye` to the **negative** `z` axis to and the `eye` to the origin. diff --git a/src/geometry/quaternion_construction.rs b/src/geometry/quaternion_construction.rs index adf733d7..82db8b47 100644 --- a/src/geometry/quaternion_construction.rs +++ b/src/geometry/quaternion_construction.rs @@ -464,6 +464,16 @@ impl UnitQuaternion { Self::from_rotation_matrix(&Rotation::::face_towards(dir, up)) } + /// Deprecated: Use [UnitQuaternion::face_towards] instead. + #[deprecated(note="renamed to `face_towards`")] + pub fn new_observer_frames(dir: &Vector, up: &Vector) -> Self + where + SB: Storage, + SC: Storage, + { + Self::face_towards(dir, up) + } + /// Builds a right-handed look-at view matrix without translation. /// /// It maps the view direction `dir` to the **negative** `z` axis. diff --git a/src/geometry/rotation_specialization.rs b/src/geometry/rotation_specialization.rs index 2be4aec4..ffb495d1 100644 --- a/src/geometry/rotation_specialization.rs +++ b/src/geometry/rotation_specialization.rs @@ -427,6 +427,16 @@ impl Rotation3 { )) } + /// Deprecated: Use [Rotation3::face_towards] instead. + #[deprecated(note="renamed to `face_towards`")] + pub fn new_observer_frames(dir: &Vector, up: &Vector) -> Self + where + SB: Storage, + SC: Storage, + { + Self::face_towards(dir, up) + } + /// Builds a right-handed look-at view matrix without translation. /// /// It maps the view direction `dir` to the **negative** `z` axis. diff --git a/src/geometry/similarity_construction.rs b/src/geometry/similarity_construction.rs index c300ea46..31a95996 100644 --- a/src/geometry/similarity_construction.rs +++ b/src/geometry/similarity_construction.rs @@ -253,6 +253,16 @@ macro_rules! similarity_construction_impl( Self::from_isometry(Isometry::<_, U3, $Rot>::face_towards(eye, target, up), scaling) } + /// Deprecated: Use [SimilarityMatrix3::face_towards] instead. + #[deprecated(note="renamed to `face_towards`")] + pub fn new_observer_frames(eye: &Point3, + target: &Point3, + up: &Vector3, + scaling: N) + -> Self { + Self::face_towards(eye, target, up, scaling) + } + /// Builds a right-handed look-at view matrix including scaling factor. /// /// This conforms to the common notion of right handed look-at matrix from the computer