diff --git a/Jolt/Physics/Body/Body.h b/Jolt/Physics/Body/Body.h index 40e52047c..6db0ce9ba 100644 --- a/Jolt/Physics/Body/Body.h +++ b/Jolt/Physics/Body/Body.h @@ -85,7 +85,8 @@ class alignas(JPH_RVECTOR_ALIGNMENT) JPH_EXPORT_GCC_BUG_WORKAROUND Body : public /// Check if this sensor detects static objects entering it. inline bool SensorDetectsStatic() const { return (mFlags.load(memory_order_relaxed) & uint8(EFlags::SensorDetectsStatic)) != 0; } - /// If PhysicsSettings::mUseManifoldReduction is true, this allows turning off manifold reduction for this specific body. Manifold reduction by default will combine contacts that come from different SubShapeIDs (e.g. different triangles or different compound shapes). + /// If PhysicsSettings::mUseManifoldReduction is true, this allows turning off manifold reduction for this specific body. + /// Manifold reduction by default will combine contacts with similar normals that come from different SubShapeIDs (e.g. different triangles in a mesh shape or different compound shapes). /// If the application requires tracking exactly which SubShapeIDs are in contact, you can turn off manifold reduction. Note that this comes at a performance cost. inline void SetUseManifoldReduction(bool inUseReduction) { JPH_ASSERT(IsRigidBody()); if (inUseReduction) mFlags.fetch_or(uint8(EFlags::UseManifoldReduction), memory_order_relaxed); else mFlags.fetch_and(uint8(~uint8(EFlags::UseManifoldReduction)), memory_order_relaxed); } diff --git a/Jolt/Physics/Collision/ContactListener.h b/Jolt/Physics/Collision/ContactListener.h index dac763103..d05c1a12e 100644 --- a/Jolt/Physics/Collision/ContactListener.h +++ b/Jolt/Physics/Collision/ContactListener.h @@ -29,7 +29,7 @@ class ContactManifold RVec3 mBaseOffset; ///< Offset to which all the contact points are relative Vec3 mWorldSpaceNormal; ///< Normal for this manifold, direction along which to move body 2 out of collision along the shortest path float mPenetrationDepth; ///< Penetration depth (move shape 2 by this distance to resolve the collision) - SubShapeID mSubShapeID1; ///< Sub shapes that formed this manifold (note that when multiple manifolds are combined because they're coplanar, we lose some information here because we only keep track of one sub shape pair that we encounter) + SubShapeID mSubShapeID1; ///< Sub shapes that formed this manifold (note that when multiple manifolds are combined because they're coplanar, we lose some information here because we only keep track of one sub shape pair that we encounter, see description at Body::SetUseManifoldReduction) SubShapeID mSubShapeID2; ContactPoints mRelativeContactPointsOn1; ///< Contact points on the surface of shape 1 relative to mBaseOffset. ContactPoints mRelativeContactPointsOn2; ///< Contact points on the surface of shape 2 relative to mBaseOffset. If there's no penetration, this will be the same as mRelativeContactPointsOn1. If there is penetration they will be different. diff --git a/Jolt/Physics/PhysicsSettings.h b/Jolt/Physics/PhysicsSettings.h index 1d18c20ed..ca3afd1d6 100644 --- a/Jolt/Physics/PhysicsSettings.h +++ b/Jolt/Physics/PhysicsSettings.h @@ -101,7 +101,7 @@ struct PhysicsSettings /// Whether or not to use the body pair cache, which removes the need for narrow phase collision detection when orientation between two bodies didn't change bool mUseBodyPairContactCache = true; - /// Whether or not to reduce manifolds with similar contact normals into one contact manifold + /// Whether or not to reduce manifolds with similar contact normals into one contact manifold (see description at Body::SetUseManifoldReduction) bool mUseManifoldReduction = true; /// If we split up large islands into smaller parallel batches of work (to improve performance)