diff options
Diffstat (limited to 'src/common/Collision/Maps/MapTree.cpp')
-rw-r--r-- | src/common/Collision/Maps/MapTree.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/common/Collision/Maps/MapTree.cpp b/src/common/Collision/Maps/MapTree.cpp index f3fe8c1f56f..1f2a8a60c73 100644 --- a/src/common/Collision/Maps/MapTree.cpp +++ b/src/common/Collision/Maps/MapTree.cpp @@ -37,7 +37,7 @@ namespace VMAP { public: MapRayCallback(ModelInstance* val, ModelIgnoreFlags ignoreFlags): prims(val), hit(false), flags(ignoreFlags) { } - bool operator()(const G3D::Ray& ray, uint32 entry, float& distance, bool pStopAtFirstHit=true) + bool operator()(const G3D::Ray& ray, uint32 entry, float& distance, bool pStopAtFirstHit = true) { bool result = prims[entry].intersectRay(ray, distance, pStopAtFirstHit, flags); if (result) @@ -55,7 +55,7 @@ namespace VMAP { public: AreaInfoCallback(ModelInstance* val): prims(val) { } - void operator()(const Vector3& point, uint32 entry) + void operator()(Vector3 const& point, uint32 entry) { #ifdef VMAP_DEBUG TC_LOG_DEBUG("maps", "AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); @@ -71,7 +71,7 @@ namespace VMAP { public: LocationInfoCallback(ModelInstance* val, LocationInfo &info): prims(val), locInfo(info), result(false) { } - void operator()(const Vector3& point, uint32 entry) + void operator()(Vector3 const& point, uint32 entry) { #ifdef VMAP_DEBUG TC_LOG_DEBUG("maps", "LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); @@ -113,15 +113,15 @@ namespace VMAP return false; } - bool StaticMapTree::GetLocationInfo(const Vector3 &pos, LocationInfo &info) const + bool StaticMapTree::GetLocationInfo(Vector3 const& pos, LocationInfo &info) const { LocationInfoCallback intersectionCallBack(iTreeValues, info); iTree.intersectPoint(pos, intersectionCallBack); return intersectionCallBack.result; } - StaticMapTree::StaticMapTree(uint32 mapID, const std::string &basePath) : - iMapID(mapID), iIsTiled(false), iTreeValues(NULL), + StaticMapTree::StaticMapTree(uint32 mapID, std::string const& basePath) : + iMapID(mapID), iIsTiled(false), iTreeValues(nullptr), iNTreeValues(0), iBasePath(basePath) { if (iBasePath.length() > 0 && iBasePath[iBasePath.length()-1] != '/' && iBasePath[iBasePath.length()-1] != '\\') @@ -153,7 +153,7 @@ namespace VMAP } //========================================================= - bool StaticMapTree::isInLineOfSight(const Vector3& pos1, const Vector3& pos2, ModelIgnoreFlags ignoreFlag) const + bool StaticMapTree::isInLineOfSight(Vector3 const& pos1, Vector3 const& pos2, ModelIgnoreFlags ignoreFlag) const { float maxDist = (pos2 - pos1).magnitude(); // return false if distance is over max float, in case of cheater teleporting to the end of the universe @@ -178,9 +178,9 @@ namespace VMAP Return the hit pos or the original dest pos */ - bool StaticMapTree::getObjectHitPos(const Vector3& pPos1, const Vector3& pPos2, Vector3& pResultHitPos, float pModifyDist) const + bool StaticMapTree::getObjectHitPos(Vector3 const& pPos1, Vector3 const& pPos2, Vector3& pResultHitPos, float pModifyDist) const { - bool result=false; + bool result = false; float maxDist = (pPos2 - pPos1).magnitude(); // valid map coords should *never ever* produce float overflow, but this would produce NaNs too ASSERT(maxDist < std::numeric_limits<float>::max()); @@ -223,7 +223,7 @@ namespace VMAP //========================================================= - float StaticMapTree::getHeight(const Vector3& pPos, float maxSearchDist) const + float StaticMapTree::getHeight(Vector3 const& pPos, float maxSearchDist) const { float height = G3D::finf(); Vector3 dir = Vector3(0, 0, -1); @@ -438,7 +438,7 @@ namespace VMAP FILE* tf = fopen(tilefile.c_str(), "rb"); if (tf) { - bool result=true; + bool result = true; char chunk[8]; if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) result = false; |