aboutsummaryrefslogtreecommitdiff
path: root/src/server/collision
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/collision')
-rwxr-xr-xsrc/server/collision/BoundingIntervalHierarchy.h5
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp2
-rw-r--r--src/server/collision/Models/GameObjectModel.cpp2
-rw-r--r--src/server/collision/Models/WorldModel.cpp2
-rw-r--r--src/server/collision/RegularGrid.h2
5 files changed, 7 insertions, 6 deletions
diff --git a/src/server/collision/BoundingIntervalHierarchy.h b/src/server/collision/BoundingIntervalHierarchy.h
index ea70fc3e322..a4bbe21006a 100755
--- a/src/server/collision/BoundingIntervalHierarchy.h
+++ b/src/server/collision/BoundingIntervalHierarchy.h
@@ -128,7 +128,7 @@ class BIH
delete[] dat.primBound;
delete[] dat.indices;
}
- uint32 primCount() { return objects.size(); }
+ uint32 primCount() const { return objects.size(); }
template<typename RayCallback>
void intersectRay(const Ray &r, RayCallback& intersectCallback, float &maxDist, bool stopAtFirst=false) const
@@ -400,7 +400,8 @@ class BIH
void buildHierarchy(std::vector<uint32> &tempTree, buildData &dat, BuildStats &stats);
- void createNode(std::vector<uint32> &tempTree, int nodeIndex, uint32 left, uint32 right) {
+ void createNode(std::vector<uint32> &tempTree, int nodeIndex, uint32 left, uint32 right) const
+ {
// write leaf node
tempTree[nodeIndex + 0] = (3 << 30) | left;
tempTree[nodeIndex + 1] = right - left + 1;
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index e7693a70de4..3bfed7d322d 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -312,7 +312,7 @@ namespace VMAP
// write WorldModel
WorldModel model;
model.setRootWmoID(raw_model.RootWMOID);
- if (raw_model.groupsArray.size())
+ if (!raw_model.groupsArray.empty())
{
std::vector<GroupModel> groupsArray;
diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp
index 84c736c22e8..8b63620e783 100644
--- a/src/server/collision/Models/GameObjectModel.cpp
+++ b/src/server/collision/Models/GameObjectModel.cpp
@@ -176,7 +176,7 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto
Ray modRay(p, iInvRot * ray.direction());
float distance = MaxDist * iInvScale;
bool hit = iModel->IntersectRay(modRay, distance, StopAtFirstHit);
- if(hit)
+ if (hit)
{
distance *= iScale;
MaxDist = distance;
diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp
index b818232fb32..b4f3f73fc98 100644
--- a/src/server/collision/Models/WorldModel.cpp
+++ b/src/server/collision/Models/WorldModel.cpp
@@ -42,7 +42,7 @@ namespace VMAP
const Vector3 p(ray.direction().cross(e2));
const float a = e1.dot(p);
- if (abs(a) < EPS) {
+ if (fabs(a) < EPS) {
// Determinant is ill-conditioned; abort early
return false;
}
diff --git a/src/server/collision/RegularGrid.h b/src/server/collision/RegularGrid.h
index 2867b29cfc1..00d7b0cd209 100644
--- a/src/server/collision/RegularGrid.h
+++ b/src/server/collision/RegularGrid.h
@@ -176,7 +176,7 @@ public:
}
if (cell == last_cell)
break;
- if(tMaxX < tMaxY)
+ if (tMaxX < tMaxY)
{
tMaxX += tDeltaX;
cell.x += stepX;