diff --git a/source/blender/blenlib/BLI_math_matrix.hh b/source/blender/blenlib/BLI_math_matrix.hh index 0d157def9a9..f901db12297 100644 --- a/source/blender/blenlib/BLI_math_matrix.hh +++ b/source/blender/blenlib/BLI_math_matrix.hh @@ -491,13 +491,10 @@ template /** * Returns true if matrix has inverted handedness. * - * \note It doesn't use determinant(mat4x4) as only the 3x3 components are needed - * when the matrix is used as a transformation to represent location/scale/rotation. + * \note It doesn't use determinant(mat4x4) as only the 3x3 components are needed assuming + * the matrix is used as a transformation to represent 3D location/scale/rotation. */ -template [[nodiscard]] bool is_negative(const MatBase &mat) -{ - return determinant(mat) < T(0); -} +template [[nodiscard]] bool is_negative(const MatBase &mat); template [[nodiscard]] bool is_negative(const MatBase &mat); /** diff --git a/source/blender/blenlib/intern/math_matrix.cc b/source/blender/blenlib/intern/math_matrix.cc index 0f0af0eefd6..beff2e257ad 100644 --- a/source/blender/blenlib/intern/math_matrix.cc +++ b/source/blender/blenlib/intern/math_matrix.cc @@ -139,13 +139,20 @@ template double determinant(const double2x2 &mat); template double determinant(const double3x3 &mat); template double determinant(const double4x4 &mat); +template bool is_negative(const MatBase &mat) +{ + return determinant(mat) < T(0); +} + template bool is_negative(const MatBase &mat) { return Eigen::Map, 0, Eigen::Stride<4, 1>>(mat.base_ptr()) .determinant() < T(0); } +template bool is_negative(const float3x3 &mat); template bool is_negative(const float4x4 &mat); +template bool is_negative(const double3x3 &mat); template bool is_negative(const double4x4 &mat); /** \} */