diff --git a/src/collision/narrowphase/SAT/SATAlgorithm.cpp b/src/collision/narrowphase/SAT/SATAlgorithm.cpp index 421a4b5d..bf613849 100644 --- a/src/collision/narrowphase/SAT/SATAlgorithm.cpp +++ b/src/collision/narrowphase/SAT/SATAlgorithm.cpp @@ -170,7 +170,6 @@ bool SATAlgorithm::testCollisionCapsuleVsConvexPolyhedron(NarrowPhaseInfo* narro // Minimum penetration depth decimal minPenetrationDepth = DECIMAL_LARGEST; uint minFaceIndex = 0; - uint minEdgeIndex = 0; bool isMinPenetrationFaceNormal = false; Vector3 separatingAxisCapsuleSpace; Vector3 separatingPolyhedronEdgeVertex1; @@ -235,7 +234,6 @@ bool SATAlgorithm::testCollisionCapsuleVsConvexPolyhedron(NarrowPhaseInfo* narro // Check if we have found a new minimum penetration axis if (penetrationDepth < minPenetrationDepth) { minPenetrationDepth = penetrationDepth; - minEdgeIndex = e; isMinPenetrationFaceNormal = false; separatingAxisCapsuleSpace = outAxis; separatingPolyhedronEdgeVertex1 = edgeVertex1; @@ -474,7 +472,8 @@ bool SATAlgorithm::testCollisionConvexPolyhedronVsConvexPolyhedron(NarrowPhaseIn uint minFaceIndex = 0; bool isMinPenetrationFaceNormal = false; bool isMinPenetrationFaceNormalPolyhedron1 = false; - uint minSeparatingEdge1Index, minSeparatingEdge2Index; + uint minSeparatingEdge1Index = 0; + uint minSeparatingEdge2Index = 0; Vector3 separatingEdge1A, separatingEdge1B; Vector3 separatingEdge2A, separatingEdge2B; Vector3 minEdgeVsEdgeSeparatingAxisPolyhedron2Space; diff --git a/src/collision/shapes/BoxShape.h b/src/collision/shapes/BoxShape.h index 7e5fba31..8148d184 100644 --- a/src/collision/shapes/BoxShape.h +++ b/src/collision/shapes/BoxShape.h @@ -206,6 +206,9 @@ inline Vector3 BoxShape::getVertexPosition(uint vertexIndex) const { case 6: return Vector3(extent.x, extent.y, -extent.z); case 7: return Vector3(-extent.x, extent.y, -extent.z); } + + assert(false); + return Vector3::zero(); } // Return the normal vector of a given face of the polyhedron diff --git a/src/containers/Map.h b/src/containers/Map.h index 3d933484..5a2b75be 100755 --- a/src/containers/Map.h +++ b/src/containers/Map.h @@ -183,7 +183,7 @@ class Map { for (int i=0; i)); mEntries[i].keyValue = nullptr; } - mEntries[i].hashCode = -1; + assert(mEntries[i].keyValue == nullptr); mEntries[i].next = mFreeIndex; mFreeIndex = i; mNbFreeEntries++; diff --git a/src/containers/Set.h b/src/containers/Set.h index f770b51d..c3a58f10 100755 --- a/src/containers/Set.h +++ b/src/containers/Set.h @@ -50,9 +50,9 @@ class Set { /// An entry of the set struct Entry { - size_t hashCode; // Hash code of the entry - int next; // Index of the next entry - V* value; // Pointer to the value stored in the entry + size_t hashCode; // Hash code of the entry + int next; // Index of the next entry + V* value; // Pointer to the value stored in the entry /// Constructor Entry() { @@ -182,7 +182,7 @@ class Set { for (int i=0; i