@@ -189,7 +189,7 @@ impl<S: BaseFloat> Matrix3<S> {
189
189
190
190
/// Create a rotation matrix that will cause a vector to point at
191
191
/// `dir`, using `up` for orientation.
192
- #[ deprecated = "Use Matrix3::look_at_lh " ]
192
+ #[ deprecated = "Use Matrix3::look_to_lh " ]
193
193
pub fn look_at ( dir : Vector3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
194
194
let dir = dir. normalize ( ) ;
195
195
let side = up. cross ( dir) . normalize ( ) ;
@@ -200,7 +200,7 @@ impl<S: BaseFloat> Matrix3<S> {
200
200
201
201
/// Create a rotation matrix that will cause a vector to point at
202
202
/// `dir`, using `up` for orientation.
203
- pub fn look_at_lh ( dir : Vector3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
203
+ pub fn look_to_lh ( dir : Vector3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
204
204
let dir = dir. normalize ( ) ;
205
205
let side = up. cross ( dir) . normalize ( ) ;
206
206
let up = dir. cross ( side) . normalize ( ) ;
@@ -210,12 +210,8 @@ impl<S: BaseFloat> Matrix3<S> {
210
210
211
211
/// Create a rotation matrix that will cause a vector to point at
212
212
/// `dir`, using `up` for orientation.
213
- pub fn look_at_rh ( dir : Vector3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
214
- let dir = -dir. normalize ( ) ;
215
- let side = up. cross ( dir) . normalize ( ) ;
216
- let up = dir. cross ( side) . normalize ( ) ;
217
-
218
- Matrix3 :: from_cols ( side, up, dir) . transpose ( )
213
+ pub fn look_to_rh ( dir : Vector3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
214
+ Matrix3 :: look_to_lh ( -dir, up)
219
215
}
220
216
221
217
/// Create a rotation matrix from a rotation around the `x` axis (pitch).
@@ -1143,12 +1139,12 @@ impl<S: BaseFloat> Transform<Point3<S>> for Matrix3<S> {
1143
1139
1144
1140
fn look_at_lh ( eye : Point3 < S > , center : Point3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
1145
1141
let dir = center - eye;
1146
- Matrix3 :: look_at_lh ( dir, up)
1142
+ Matrix3 :: look_to_lh ( dir, up)
1147
1143
}
1148
1144
1149
1145
fn look_at_rh ( eye : Point3 < S > , center : Point3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
1150
1146
let dir = center - eye;
1151
- Matrix3 :: look_at_rh ( dir, up)
1147
+ Matrix3 :: look_to_rh ( dir, up)
1152
1148
}
1153
1149
1154
1150
fn transform_vector ( & self , vec : Vector3 < S > ) -> Vector3 < S > {
0 commit comments