mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
commit
d4f4580a7c
2 changed files with 7 additions and 3 deletions
|
@ -270,7 +270,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
|
|||
}
|
||||
|
||||
// create some variables to hold temporary results
|
||||
#ifdef DEBUG
|
||||
#ifndef NDEBUG
|
||||
uint32_t numPoints = points.size();
|
||||
#endif
|
||||
const btVector3 p0(0.0f, 0.0f, 0.0f);
|
||||
|
@ -283,9 +283,11 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
|
|||
uint32_t numTriangles = triangleIndices.size() / 3;
|
||||
for (uint32_t i = 0; i < numTriangles; ++i) {
|
||||
uint32_t t = 3 * i;
|
||||
#ifndef NDEBUG
|
||||
assert(triangleIndices[t] < numPoints);
|
||||
assert(triangleIndices[t + 1] < numPoints);
|
||||
assert(triangleIndices[t + 2] < numPoints);
|
||||
#endif
|
||||
|
||||
// extract raw vertices
|
||||
tetraPoints[0] = p0;
|
||||
|
|
|
@ -118,13 +118,15 @@ public:
|
|||
|
||||
template <typename Function>
|
||||
void withPush(Function f) {
|
||||
#ifdef DEBUG
|
||||
#ifndef NDEBUG
|
||||
size_t startingDepth = size();
|
||||
#endif
|
||||
push();
|
||||
f();
|
||||
pop();
|
||||
assert(startingDepth = size());
|
||||
#ifndef NDEBUG
|
||||
assert(startingDepth == size());
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename Function>
|
||||
|
|
Loading…
Reference in a new issue