diff options
Diffstat (limited to 'extern/mantaflow/helper/util/vectorbase.h')
-rw-r--r-- | extern/mantaflow/helper/util/vectorbase.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/extern/mantaflow/helper/util/vectorbase.h b/extern/mantaflow/helper/util/vectorbase.h index 41584663a0f..9ccf445f42c 100644 --- a/extern/mantaflow/helper/util/vectorbase.h +++ b/extern/mantaflow/helper/util/vectorbase.h @@ -248,12 +248,14 @@ template<class S> class Vector3D { protected: }; -//! helper to check whether float/double value is non-zero -inline bool notZero(Real f) +//! helper to check whether value is non-zero +template<class S> inline bool notZero(S v) { - if (std::abs(f) > VECTOR_EPSILON) - return true; - return false; + return (std::abs(v) > VECTOR_EPSILON); +} +template<class S> inline bool notZero(Vector3D<S> v) +{ + return (std::abs(norm(v)) > VECTOR_EPSILON); } //************************************************************************ |