use std::abs instead of abs to allow the floats to be used instead of having roundoffs

This commit is contained in:
DarthArgus
2016-09-26 06:24:22 +00:00
parent 6ceefdceb0
commit 81ac74a4ff
5 changed files with 7 additions and 12 deletions
@@ -3,11 +3,6 @@
#include <ctime>
//real abs(real x)
//{
// return fabs(x);
//}
int _stricmp(const char* string1, const char* string2)
{
int first, second;
@@ -540,7 +540,7 @@ inline void Transform::move_l(const Vector &vec)
inline bool Transform::isYawOnly(void) const
{
return abs(matrix[1][1] - 1.0f) < 0.00001f;
return std::abs(matrix[1][1] - 1.0f) < 0.00001f;
}
// ----------------------------------------------------------------------
@@ -550,9 +550,9 @@ inline bool Transform::isYawOnly(void) const
inline bool Transform::isTranslateOnly(void) const
{
if(abs(matrix[0][0] - 1.0f) > 0.00001f) return false;
if(abs(matrix[1][1] - 1.0f) > 0.00001f) return false;
if(abs(matrix[2][2] - 1.0f) > 0.00001f) return false;
if(std::abs(matrix[0][0] - 1.0f) > 0.00001f) return false;
if(std::abs(matrix[1][1] - 1.0f) > 0.00001f) return false;
if(std::abs(matrix[2][2] - 1.0f) > 0.00001f) return false;
return true;
}
@@ -100,7 +100,7 @@ inline bool VectorArgb::operator !=(const VectorArgb &rhs) const
inline float VectorArgb::rgbIntensity() const
{
return abs(r) * 0.30f + abs(g) * 0.59f + abs(b) * 0.11f;
return std::abs(r) * 0.30f + std::abs(g) * 0.59f + std::abs(b) * 0.11f;
}
// ----------------------------------------------------------------------
@@ -104,7 +104,7 @@ inline bool VectorRgba::operator !=(VectorRgba const & rhs) const
inline float VectorRgba::rgbIntensity() const
{
return abs(r) * 0.30f + abs(g) * 0.59f + abs(b) * 0.11f;
return std::abs(r) * 0.30f + std::abs(g) * 0.59f + std::abs(b) * 0.11f;
}
// ----------------------------------------------------------------------
@@ -94,7 +94,7 @@ inline float Torus::getMinorRadius ( void ) const
inline bool Torus::isOriented ( void ) const
{
return fabs(m_axis.y - 1.0f) > 0.00001f;
return std::abs(m_axis.y - 1.0f) > 0.00001f;
}
// ----------------------------------------------------------------------