|
@@ -999,10 +999,13 @@ void PhysicsSystem::ProcessBodyPair(ContactAllocator &ioContactAllocator, const
|
|
|
if (body_pair_handle == nullptr)
|
|
|
return; // Out of cache space
|
|
|
|
|
|
+ // If we want enhanced active edge detection for this body pair
|
|
|
+ bool enhanced_active_edges = body1->GetEnhancedInternalEdgeRemovalWithBody(*body2);
|
|
|
+
|
|
|
// Create the query settings
|
|
|
CollideShapeSettings settings;
|
|
|
settings.mCollectFacesMode = ECollectFacesMode::CollectFaces;
|
|
|
- settings.mActiveEdgeMode = mPhysicsSettings.mCheckActiveEdges? EActiveEdgeMode::CollideOnlyWithActive : EActiveEdgeMode::CollideWithAll;
|
|
|
+ settings.mActiveEdgeMode = mPhysicsSettings.mCheckActiveEdges && !enhanced_active_edges? EActiveEdgeMode::CollideOnlyWithActive : EActiveEdgeMode::CollideWithAll;
|
|
|
settings.mMaxSeparationDistance = body1->IsSensor() || body2->IsSensor()? 0.0f : mPhysicsSettings.mSpeculativeContactDistance;
|
|
|
settings.mActiveEdgeMovementDirection = body1->GetLinearVelocity() - body2->GetLinearVelocity();
|
|
|
|
|
@@ -1126,7 +1129,7 @@ void PhysicsSystem::ProcessBodyPair(ContactAllocator &ioContactAllocator, const
|
|
|
|
|
|
// Perform collision detection between the two shapes
|
|
|
SubShapeIDCreator part1, part2;
|
|
|
- auto f = body1->GetEnhancedInternalEdgeRemovalWithBody(*body2)? InternalEdgeRemovingCollector::sCollideShapeVsShape : CollisionDispatch::sCollideShapeVsShape;
|
|
|
+ auto f = enhanced_active_edges? InternalEdgeRemovingCollector::sCollideShapeVsShape : CollisionDispatch::sCollideShapeVsShape;
|
|
|
f(body1->GetShape(), body2->GetShape(), Vec3::sReplicate(1.0f), Vec3::sReplicate(1.0f), transform1, transform2, part1, part2, settings, collector, { });
|
|
|
|
|
|
// Add the contacts
|
|
@@ -1227,7 +1230,7 @@ void PhysicsSystem::ProcessBodyPair(ContactAllocator &ioContactAllocator, const
|
|
|
|
|
|
// Perform collision detection between the two shapes
|
|
|
SubShapeIDCreator part1, part2;
|
|
|
- auto f = body1->GetEnhancedInternalEdgeRemovalWithBody(*body2)? InternalEdgeRemovingCollector::sCollideShapeVsShape : CollisionDispatch::sCollideShapeVsShape;
|
|
|
+ auto f = enhanced_active_edges? InternalEdgeRemovingCollector::sCollideShapeVsShape : CollisionDispatch::sCollideShapeVsShape;
|
|
|
f(body1->GetShape(), body2->GetShape(), Vec3::sReplicate(1.0f), Vec3::sReplicate(1.0f), transform1, transform2, part1, part2, settings, collector, { });
|
|
|
|
|
|
constraint_created = collector.mConstraintCreated;
|