Skip to content

Commit

Permalink
Updated documentation for mMaxSeparationDistance
Browse files Browse the repository at this point in the history
Based on question #1379
  • Loading branch information
jrouwe committed Dec 5, 2024
1 parent c6b6bca commit e0e434f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Jolt/Physics/Collision/CollideShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CollideShapeResult
Vec3 mContactPointOn1; ///< Contact point on the surface of shape 1 (in world space or relative to base offset)
Vec3 mContactPointOn2; ///< Contact point on the surface of shape 2 (in world space or relative to base offset). If the penetration depth is 0, this will be the same as mContactPointOn1.
Vec3 mPenetrationAxis; ///< Direction to move shape 2 out of collision along the shortest path (magnitude is meaningless, in world space). You can use -mPenetrationAxis.Normalized() as contact normal.
float mPenetrationDepth; ///< Penetration depth (move shape 2 by this distance to resolve the collision)
float mPenetrationDepth; ///< Penetration depth (move shape 2 by this distance to resolve the collision). If CollideShapeSettings::mMaxSeparationDistance > 0 this number can be negative to indicate that the objects are separated by -mPenetrationDepth. The contact points are the closest points in that case.
SubShapeID mSubShapeID1; ///< Sub shape ID that identifies the face on shape 1
SubShapeID mSubShapeID2; ///< Sub shape ID that identifies the face on shape 2
BodyID mBodyID2; ///< BodyID to which shape 2 belongs to
Expand Down Expand Up @@ -95,7 +95,8 @@ class CollideShapeSettings : public CollideSettingsBase
public:
JPH_OVERRIDE_NEW_DELETE

/// When > 0 contacts in the vicinity of the query shape can be found. All nearest contacts that are not further away than this distance will be found (unit: meter)
/// When > 0 contacts in the vicinity of the query shape can be found. All nearest contacts that are not further away than this distance will be found.
/// Note that in this case CollideShapeResult::mPenetrationDepth can become negative to indicate that objects are not overlapping. (unit: meter)
float mMaxSeparationDistance = 0.0f;

/// How backfacing triangles should be treated
Expand Down

0 comments on commit e0e434f

Please sign in to comment.