Skip to content

Commit

Permalink
Check if a vector can be normalized (fix #2088)
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kwsm committed Nov 21, 2019
1 parent ac33dc4 commit 6af03f1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/math/vector3.cpp
Expand Up @@ -151,13 +151,9 @@ namespace OpenBabel
*/
vector3& vector3 :: normalize ()
{
#ifdef OB_OLD_MATH_CHECKS
if( CanBeNormalized() )
(*this) /= length();
#else
(*this) /= length();
#endif
return(*this);
if (CanBeNormalized())
*this /= length();
return *this;
}

OBAPI vector3 cross ( const vector3& v1, const vector3& v2 )
Expand Down

0 comments on commit 6af03f1

Please sign in to comment.