mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
Removed STLport requirement
This commit is contained in:
@@ -260,7 +260,7 @@ void CompressedQuaternionNamespace::findClosestBase(int baseShiftCount, float mi
|
||||
for (int testBaseIndex = 0; testBaseIndex < baseCount; ++testBaseIndex)
|
||||
{
|
||||
const float testBaseValue = -1.0f + (testBaseIndex + 1) * baseSeparation;
|
||||
const float testDistance = abs(testBaseValue - midpoint);
|
||||
const float testDistance = std::abs(testBaseValue - midpoint);
|
||||
|
||||
if (testDistance < closestBaseDistance)
|
||||
{
|
||||
@@ -349,7 +349,7 @@ uint32 CompressedQuaternionNamespace::doCompress(float w, float x, float y, floa
|
||||
|
||||
#ifdef _DEBUG
|
||||
// If w is small enough, we won't be able to take the square root.
|
||||
if (abs(w) >= cs_wAcceptableEpsilon)
|
||||
if (std::abs(w) >= cs_wAcceptableEpsilon)
|
||||
{
|
||||
const float calculatedW = sqrt(1.0f - (x*x + y*y + z*z));
|
||||
DEBUG_FATAL(!WithinEpsilonInclusive(calculatedW, w, cs_wAcceptableEpsilon), ("Quaternion (w=%g,x=%g,y=%g,z=%g) does not appear to be a unit quaternion.", w, x, y, z));
|
||||
@@ -546,10 +546,10 @@ void CompressedQuaternion::compressRotations(const QuaternionVector &sourceRotat
|
||||
sourceRotation.z = -sourceRotation.z;
|
||||
}
|
||||
|
||||
const float deltaW = abs(expandedRotation.w - sourceRotation.w);
|
||||
const float deltaX = abs(expandedRotation.x - sourceRotation.x);
|
||||
const float deltaY = abs(expandedRotation.y - sourceRotation.y);
|
||||
const float deltaZ = abs(expandedRotation.z - sourceRotation.z);
|
||||
const float deltaW = std::abs(expandedRotation.w - sourceRotation.w);
|
||||
const float deltaX = std::abs(expandedRotation.x - sourceRotation.x);
|
||||
const float deltaY = std::abs(expandedRotation.y - sourceRotation.y);
|
||||
const float deltaZ = std::abs(expandedRotation.z - sourceRotation.z);
|
||||
|
||||
if ( (deltaW > cs_wAcceptableEpsilon) ||
|
||||
(deltaX > cs_xAcceptableEpsilon) ||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "sharedMath/MxCifQuadTree.h"
|
||||
#include "sharedMath/MxCifQuadTreeBounds.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "sharedMath/Vector.h"
|
||||
|
||||
#include <hash_map>
|
||||
#include <tr1/unordered_map>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
typedef std::hash_multimap<uint32 /*crc*/, int /*index*/> VertexIndexMap;
|
||||
typedef std::tr1::unordered_multimap<uint32 /*crc*/, int /*index*/> VertexIndexMap;
|
||||
|
||||
VectorVector * m_vertices;
|
||||
VertexIndexMap * m_indexMap;
|
||||
|
||||
@@ -97,14 +97,14 @@ inline void Rectangle2d::set (const float newX0, const float newY0, const float
|
||||
|
||||
inline float Rectangle2d::getWidth () const
|
||||
{
|
||||
return abs(x1 - x0);
|
||||
return std::abs(x1 - x0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
inline float Rectangle2d::getHeight () const
|
||||
{
|
||||
return abs(y1 - y0);
|
||||
return std::abs(y1 - y0);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "sharedMath/Capsule.h"
|
||||
#include "sharedMath/SpatialSubdivision.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
static const float SphereTreeEpsilon = 0.01f;
|
||||
@@ -1436,7 +1437,7 @@ inline void SphereTreeNode<ObjectType, ExtentAccessor>::resizeRealSphere(const f
|
||||
float BR = realSphere.getRadius();
|
||||
|
||||
float D = A.magnitudeBetween(B);
|
||||
float O = abs(AR - (D + BR));
|
||||
float O = std::abs(AR - (D + BR));
|
||||
|
||||
// Fatal if the error is significant, otherwise just warn.
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "sharedRandom/Random.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
// ======================================================================
|
||||
@@ -284,7 +285,7 @@ bool Vector::inPolygon(const std::vector<Vector> &convexPolygonVertices) const
|
||||
*/
|
||||
bool Vector::withinEpsilon(const Vector &rhs, float epsilon) const
|
||||
{
|
||||
return (abs(x - rhs.x) < epsilon) && (abs(y - rhs.y) < epsilon) && (abs(z - rhs.z) < epsilon);
|
||||
return (std::abs(x - rhs.x) < epsilon) && (std::abs(y - rhs.y) < epsilon) && (std::abs(z - rhs.z) < epsilon);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,9 +298,9 @@ bool Vector::withinEpsilon(const Vector &rhs, float epsilon) const
|
||||
const Vector Vector::perpendicular(Vector const & direction)
|
||||
{
|
||||
// Measure the projection of "direction" onto each of the axes
|
||||
float const id = abs(direction.dot(Vector::unitX));
|
||||
float const jd = abs(direction.dot(Vector::unitY));
|
||||
float const kd = abs(direction.dot(Vector::unitZ));
|
||||
float const id = std::abs(direction.dot(Vector::unitX));
|
||||
float const jd = std::abs(direction.dot(Vector::unitY));
|
||||
float const kd = std::abs(direction.dot(Vector::unitZ));
|
||||
|
||||
Vector result;
|
||||
|
||||
|
||||
@@ -265,9 +265,9 @@ inline real Vector::magnitudeSquared(void) const
|
||||
|
||||
inline real Vector::approximateMagnitude(void) const
|
||||
{
|
||||
real minc = abs(x);
|
||||
real midc = abs(y);
|
||||
real maxc = abs(z);
|
||||
real minc = std::abs(x);
|
||||
real midc = std::abs(y);
|
||||
real maxc = std::abs(z);
|
||||
|
||||
// sort the vectors
|
||||
// we do our own swapping to avoid heavy-weight includes in such a low-level class
|
||||
|
||||
@@ -221,7 +221,7 @@ float MultiShape::calcAvoidanceRadius ( void ) const
|
||||
float sinTheta = m_axisY.y;
|
||||
float cosTheta = sqrt( m_axisY.x * m_axisY.x + m_axisY.z * m_axisY.z );
|
||||
|
||||
float twoContactRadius = abs(m_extentY * sinTheta + m_extentX * cosTheta);
|
||||
float twoContactRadius = std::abs(m_extentY * sinTheta + m_extentX * cosTheta);
|
||||
|
||||
float blah = m_extentY * sinTheta;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ RangeLoop::RangeLoop ( float min, float max )
|
||||
: m_min( clip(min) ),
|
||||
m_max( clip(max) )
|
||||
{
|
||||
if(abs(max-min) >= 1.0f)
|
||||
if(std::abs(max-min) >= 1.0f)
|
||||
{
|
||||
m_min = 0.0f;
|
||||
m_max = 1.0f;
|
||||
|
||||
Reference in New Issue
Block a user