@@ -874,6 +874,7 @@ void CollisionDetectionSystem::createContacts() {
874
874
for (uint32 m=0 ; m < contactPair.nbPotentialContactManifolds ; m++) {
875
875
876
876
ContactManifoldInfo& potentialManifold = mPotentialContactManifolds [contactPair.potentialContactManifoldsIndices [m]];
877
+ assert (potentialManifold.nbPotentialContactPoints > 0 );
877
878
878
879
// Start index and number of contact points for this manifold
879
880
const uint32 contactPointsIndex = static_cast <uint32>(mCurrentContactPoints ->size ());
@@ -985,6 +986,7 @@ void CollisionDetectionSystem::createSnapshotContacts(Array<ContactPair>& contac
985
986
for (uint32 m=0 ; m < contactPair.nbPotentialContactManifolds ; m++) {
986
987
987
988
ContactManifoldInfo& potentialManifold = potentialContactManifolds[contactPair.potentialContactManifoldsIndices [m]];
989
+ assert (potentialManifold.nbPotentialContactPoints > 0 );
988
990
989
991
// Start index and number of contact points for this manifold
990
992
const uint32 contactPointsIndex = static_cast <uint32>(contactPoints.size ());
@@ -1186,8 +1188,11 @@ void CollisionDetectionSystem::processPotentialContacts(NarrowPhaseInfoBatch& na
1186
1188
const Entity body1Entity = mCollidersComponents .mBodiesEntities [collider1Index];
1187
1189
const Entity body2Entity = mCollidersComponents .mBodiesEntities [collider2Index];
1188
1190
1191
+ assert (narrowPhaseInfoBatch.narrowPhaseInfos [i].nbContactPoints > 0 );
1192
+
1189
1193
// If we have a convex vs convex collision (if we consider the base collision shapes of the colliders)
1190
- if (mCollidersComponents .mCollisionShapes [collider1Index]->isConvex () && mCollidersComponents .mCollisionShapes [collider2Index]->isConvex ()) {
1194
+ if (mCollidersComponents .mCollisionShapes [collider1Index]->isConvex () &&
1195
+ mCollidersComponents .mCollisionShapes [collider2Index]->isConvex ()) {
1191
1196
1192
1197
// Create a new ContactPair
1193
1198
@@ -1226,6 +1231,7 @@ void CollisionDetectionSystem::processPotentialContacts(NarrowPhaseInfoBatch& na
1226
1231
}
1227
1232
1228
1233
// Add the contact manifold to the overlapping pair contact
1234
+ assert (potentialContactManifolds[contactManifoldIndex].nbPotentialContactPoints > 0 );
1229
1235
assert (pairId == contactManifoldInfo.pairId );
1230
1236
pairContact->potentialContactManifoldsIndices [0 ] = contactManifoldIndex;
1231
1237
pairContact->nbPotentialContactManifolds = 1 ;
@@ -1259,6 +1265,7 @@ void CollisionDetectionSystem::processPotentialContacts(NarrowPhaseInfoBatch& na
1259
1265
}
1260
1266
1261
1267
assert (pairContact != nullptr );
1268
+ assert (narrowPhaseInfoBatch.narrowPhaseInfos [i].nbContactPoints > 0 );
1262
1269
1263
1270
// Add the potential contacts
1264
1271
for (uint32 j=0 ; j < narrowPhaseInfoBatch.narrowPhaseInfos [i].nbContactPoints ; j++) {
@@ -1275,12 +1282,15 @@ void CollisionDetectionSystem::processPotentialContacts(NarrowPhaseInfoBatch& na
1275
1282
// For each contact manifold of the overlapping pair
1276
1283
for (uint32 m=0 ; m < pairContact->nbPotentialContactManifolds ; m++) {
1277
1284
1285
+ assert (m < pairContact->nbPotentialContactManifolds );
1286
+
1278
1287
uint32 contactManifoldIndex = pairContact->potentialContactManifoldsIndices [m];
1279
1288
1289
+ assert (potentialContactManifolds[contactManifoldIndex].nbPotentialContactPoints > 0 );
1290
+
1280
1291
if (potentialContactManifolds[contactManifoldIndex].nbPotentialContactPoints < NB_MAX_CONTACT_POINTS_IN_POTENTIAL_MANIFOLD) {
1281
1292
1282
1293
// Get the first contact point of the current manifold
1283
- assert (potentialContactManifolds[contactManifoldIndex].nbPotentialContactPoints > 0 );
1284
1294
const uint manifoldContactPointIndex = potentialContactManifolds[contactManifoldIndex].potentialContactPointsIndices [0 ];
1285
1295
const ContactPointInfo& manifoldContactPoint = potentialContactPoints[manifoldContactPointIndex];
1286
1296
@@ -1314,6 +1324,7 @@ void CollisionDetectionSystem::processPotentialContacts(NarrowPhaseInfoBatch& na
1314
1324
assert (pairContact != nullptr );
1315
1325
1316
1326
// Add the contact manifold to the overlapping pair contact
1327
+ assert (potentialContactManifolds[contactManifoldIndex].nbPotentialContactPoints > 0 );
1317
1328
assert (pairContact->pairId == contactManifoldInfo.pairId );
1318
1329
pairContact->potentialContactManifoldsIndices [pairContact->nbPotentialContactManifolds ] = contactManifoldIndex;
1319
1330
pairContact->nbPotentialContactManifolds ++;
@@ -1350,6 +1361,7 @@ void CollisionDetectionSystem::reducePotentialContactManifolds(Array<ContactPair
1350
1361
for (uint32 j=0 ; j < contactPair.nbPotentialContactManifolds ; j++) {
1351
1362
1352
1363
ContactManifoldInfo& manifold = potentialContactManifolds[contactPair.potentialContactManifoldsIndices [j]];
1364
+ assert (manifold.nbPotentialContactPoints > 0 );
1353
1365
1354
1366
// Get the largest contact point penetration depth of the manifold
1355
1367
const decimal depth = computePotentialManifoldLargestContactDepth (manifold, potentialContactPoints);
@@ -1375,6 +1387,7 @@ void CollisionDetectionSystem::reducePotentialContactManifolds(Array<ContactPair
1375
1387
for (uint32 j=0 ; j < pairContact.nbPotentialContactManifolds ; j++) {
1376
1388
1377
1389
ContactManifoldInfo& manifold = potentialContactManifolds[pairContact.potentialContactManifoldsIndices [j]];
1390
+ assert (manifold.nbPotentialContactPoints > 0 );
1378
1391
1379
1392
// If there are two many contact points in the manifold
1380
1393
if (manifold.nbPotentialContactPoints > MAX_CONTACT_POINTS_IN_MANIFOLD) {
@@ -1611,6 +1624,8 @@ void CollisionDetectionSystem::removeDuplicatedContactPointsInManifold(ContactMa
1611
1624
1612
1625
RP3D_PROFILE (" CollisionDetectionSystem::removeDuplicatedContactPointsInManifold()" , mProfiler );
1613
1626
1627
+ assert (manifold.nbPotentialContactPoints > 0 );
1628
+
1614
1629
const decimal distThresholdSqr = SAME_CONTACT_POINT_DISTANCE_THRESHOLD * SAME_CONTACT_POINT_DISTANCE_THRESHOLD;
1615
1630
1616
1631
// For each contact point of the manifold
@@ -1634,6 +1649,8 @@ void CollisionDetectionSystem::removeDuplicatedContactPointsInManifold(ContactMa
1634
1649
}
1635
1650
}
1636
1651
}
1652
+
1653
+ assert (manifold.nbPotentialContactPoints > 0 );
1637
1654
}
1638
1655
1639
1656
// Report contacts and triggers
0 commit comments