@@ -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).
@@ -1135,12 +1131,12 @@ impl<S: BaseFloat> Transform<Point3<S>> for Matrix3<S> {
1135
1131
1136
1132
fn look_at_lh ( eye : Point3 < S > , center : Point3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
1137
1133
let dir = center - eye;
1138
- Matrix3 :: look_at_lh ( dir, up)
1134
+ Matrix3 :: look_to_lh ( dir, up)
1139
1135
}
1140
1136
1141
1137
fn look_at_rh ( eye : Point3 < S > , center : Point3 < S > , up : Vector3 < S > ) -> Matrix3 < S > {
1142
1138
let dir = center - eye;
1143
- Matrix3 :: look_at_rh ( dir, up)
1139
+ Matrix3 :: look_to_rh ( dir, up)
1144
1140
}
1145
1141
1146
1142
fn transform_vector ( & self , vec : Vector3 < S > ) -> Vector3 < S > {
0 commit comments