MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / normalize3

Method normalize3

encoder/basisu_math.h:670–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668 }
669
670 inline double normalize3(const vec* pDefaultVec = NULL)
671 {
672 static_assert(N >= 3);
673
674 double n = m_s[0] * m_s[0] + m_s[1] * m_s[1] + m_s[2] * m_s[2];
675
676 if (n != 0)
677 *this *= static_cast<T>((1.0f / sqrt(n)));
678 else if (pDefaultVec)
679 *this = *pDefaultVec;
680 return n;
681 }
682
683 inline vec& normalize_in_place(const vec* pDefaultVec = NULL)
684 {

Callers 1

get_normalized3Method · 0.45

Calls 1

sqrtFunction · 0.85

Tested by

no test coverage detected