Merge pull request #934 from kkimdev/BT_ID_

Add and use BT_ID_* math functions for idScalar.
This commit is contained in:
erwincoumans
2017-01-29 21:10:25 -08:00
committed by GitHub
6 changed files with 53 additions and 43 deletions

View File

@@ -24,7 +24,7 @@ idScalar calculateNorm(T&);
// only implemented for vec3
template <>
idScalar calculateNorm(vec3& v) {
return std::sqrt(BT_ID_POW(v(0), 2) + BT_ID_POW(v(1), 2) + BT_ID_POW(v(2), 2));
return BT_ID_SQRT(BT_ID_POW(v(0), 2) + BT_ID_POW(v(1), 2) + BT_ID_POW(v(2), 2));
}
// template function to convert a DiffType (finite differences)