From c4e4cb1b5c4b407c44da30fb254a6c248503451b Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 30 Jan 2013 09:06:19 +0100 Subject: Core/Misc: Remove using directive from header files (It will eventually lead to name collisions) --- src/server/collision/BoundingIntervalHierarchy.h | 33 +++++++----------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'src/server/collision/BoundingIntervalHierarchy.h') diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h index 7cbaedbfba6..997f9c99e5f 100644 --- a/src/server/collision/BoundingIntervalHierarchy.h +++ b/src/server/collision/BoundingIntervalHierarchy.h @@ -31,20 +31,8 @@ #include #include -#ifdef __APPLE__ - #define isnan(x) ( std::isnan(x) ) -#endif - #define MAX_STACK_SIZE 64 -#ifdef _MSC_VER - #define isnan(x) _isnan(x) -#endif - -using G3D::Vector3; -using G3D::AABox; -using G3D::Ray; - static inline uint32 floatToRawIntBits(float f) { union @@ -69,7 +57,7 @@ static inline float intBitsToFloat(uint32 i) struct AABound { - Vector3 lo, hi; + G3D::Vector3 lo, hi; }; /** Bounding Interval Hierarchy Class. @@ -105,12 +93,11 @@ class BIH dat.maxPrims = leafSize; dat.numPrims = primitives.size(); dat.indices = new uint32[dat.numPrims]; - dat.primBound = new AABox[dat.numPrims]; + dat.primBound = new G3D::AABox[dat.numPrims]; getBounds(primitives[0], bounds); for (uint32 i=0; i - void intersectRay(const Ray &r, RayCallback& intersectCallback, float &maxDist, bool stopAtFirst=false) const + void intersectRay(const G3D::Ray &r, RayCallback& intersectCallback, float &maxDist, bool stopAtFirst=false) const { float intervalMin = -1.f; float intervalMax = -1.f; - Vector3 org = r.origin(); - Vector3 dir = r.direction(); - Vector3 invDir; + G3D::Vector3 org = r.origin(); + G3D::Vector3 dir = r.direction(); + G3D::Vector3 invDir; for (int i=0; i<3; ++i) { invDir[i] = 1.f / dir[i]; @@ -270,7 +257,7 @@ class BIH } template - void intersectPoint(const Vector3 &p, IsectCallback& intersectCallback) const + void intersectPoint(const G3D::Vector3 &p, IsectCallback& intersectCallback) const { if (!bounds.contains(p)) return; @@ -353,12 +340,12 @@ class BIH protected: std::vector tree; std::vector objects; - AABox bounds; + G3D::AABox bounds; struct buildData { uint32 *indices; - AABox *primBound; + G3D::AABox *primBound; uint32 numPrims; int maxPrims; }; @@ -410,4 +397,4 @@ class BIH void subdivide(int left, int right, std::vector &tempTree, buildData &dat, AABound &gridBox, AABound &nodeBox, int nodeIndex, int depth, BuildStats &stats); }; -#endif // _BIH_H \ No newline at end of file +#endif // _BIH_H -- cgit v1.2.3