diff --git a/Code/OysterMath/LinearMath.h b/Code/OysterMath/LinearMath.h index ebb1e375..9b21fc02 100644 --- a/Code/OysterMath/LinearMath.h +++ b/Code/OysterMath/LinearMath.h @@ -794,7 +794,7 @@ namespace LinearAlgebra3D { ::LinearAlgebra::Vector4 worldStartNormal( WorldAxisOf(Rotation(startAngularAxis.xyz), localStartNormal.xyz), (ScalarType)0 ); targetMem = ::LinearAlgebra::Vector4( worldStartNormal.xyz.Cross(worldEndNormal.xyz), (ScalarType)0); - targetMem *= (ScalarType)::std::acos( worldStartNormal.Dot(worldEndNormal) ); + targetMem *= (ScalarType)::std::acos( ::Utility::Value::Clamp(worldStartNormal.Dot(worldEndNormal), (ScalarType)0, (ScalarType)1) ); return targetMem += startAngularAxis; }