Check norm_squared instead of mangnitude.
This commit is contained in:
parent
7ea9ecee08
commit
469390f4b9
|
@ -228,8 +228,9 @@ where
|
||||||
|
|
||||||
for i in (0..dim - shift).rev() {
|
for i in (0..dim - shift).rev() {
|
||||||
let axis = self.uv.view_range(i + shift.., i);
|
let axis = self.uv.view_range(i + shift.., i);
|
||||||
|
|
||||||
// Sometimes, the axis might have a zero magnitude.
|
// Sometimes, the axis might have a zero magnitude.
|
||||||
if axis.magnitude().is_zero() {
|
if axis.norm_squared().is_zero() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let refl = Reflection::new(Unit::new_unchecked(axis), T::zero());
|
let refl = Reflection::new(Unit::new_unchecked(axis), T::zero());
|
||||||
|
@ -267,8 +268,9 @@ where
|
||||||
let axis = self.uv.view_range(i, i + shift..);
|
let axis = self.uv.view_range(i, i + shift..);
|
||||||
let mut axis_packed = axis_packed.rows_range_mut(i + shift..);
|
let mut axis_packed = axis_packed.rows_range_mut(i + shift..);
|
||||||
axis_packed.tr_copy_from(&axis);
|
axis_packed.tr_copy_from(&axis);
|
||||||
|
|
||||||
// Sometimes, the axis might have a zero magnitude.
|
// Sometimes, the axis might have a zero magnitude.
|
||||||
if axis_packed.magnitude().is_zero() {
|
if axis_packed.norm_squared().is_zero() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let refl = Reflection::new(Unit::new_unchecked(axis_packed), T::zero());
|
let refl = Reflection::new(Unit::new_unchecked(axis_packed), T::zero());
|
||||||
|
|
Loading…
Reference in New Issue