Loading [MathJax]/extensions/tex2jax.js
Jolt Physics
A multi core friendly Game Physics Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ManifoldBetweenTwoFaces.h File Reference

Go to the source code of this file.

Functions

JPH_NAMESPACE_BEGIN JPH_EXPORT void PruneContactPoints (Vec3Arg inPenetrationAxis, ContactPoints &ioContactPointsOn1, ContactPoints &ioContactPointsOn2, RVec3Arg inCenterOfMass)
 
JPH_EXPORT void ManifoldBetweenTwoFaces (Vec3Arg inContactPoint1, Vec3Arg inContactPoint2, Vec3Arg inPenetrationAxis, float inMaxContactDistance, const ConvexShape::SupportingFace &inShape1Face, const ConvexShape::SupportingFace &inShape2Face, ContactPoints &outContactPoints1, ContactPoints &outContactPoints2, RVec3Arg inCenterOfMass)
 

Function Documentation

◆ ManifoldBetweenTwoFaces()

JPH_EXPORT void ManifoldBetweenTwoFaces ( Vec3Arg  inContactPoint1,
Vec3Arg  inContactPoint2,
Vec3Arg  inPenetrationAxis,
float  inMaxContactDistance,
const ConvexShape::SupportingFace inShape1Face,
const ConvexShape::SupportingFace inShape2Face,
ContactPoints outContactPoints1,
ContactPoints outContactPoints2,
RVec3Arg  inCenterOfMass 
)

Determine contact points between 2 faces of 2 shapes and return them in outContactPoints 1 & 2

Parameters
inContactPoint1The contact point on shape 1 relative to inCenterOfMass
inContactPoint2The contact point on shape 2 relative to inCenterOfMass
inPenetrationAxisThe local space penetration axis in world space
inMaxContactDistanceAfter face 2 is clipped against face 1, each remaining point on face 2 is tested against the plane of face 1. If the distance on the positive side of the plane is larger than this distance, the point will be discarded as a contact point.
inShape1FaceThe supporting faces on shape 1 relative to inCenterOfMass
inShape2FaceThe supporting faces on shape 2 relative to inCenterOfMass
outContactPoints1Returns the contact points between the two shapes for shape 1 relative to inCenterOfMass (any existing points in the output array are left as is)
outContactPoints2Returns the contact points between the two shapes for shape 2 relative to inCenterOfMass (any existing points in the output array are left as is)
inCenterOfMassCenter of mass position of body 1

◆ PruneContactPoints()

JPH_NAMESPACE_BEGIN JPH_EXPORT void PruneContactPoints ( Vec3Arg  inPenetrationAxis,
ContactPoints ioContactPointsOn1,
ContactPoints ioContactPointsOn2,
RVec3Arg  inCenterOfMass 
)

Remove contact points if there are > 4 (no more than 4 are needed for a stable solution)

Parameters
inPenetrationAxisis the world space penetration axis (must be normalized)
ioContactPointsOn1The contact points on shape 1 relative to inCenterOfMass
ioContactPointsOn2The contact points on shape 2 relative to inCenterOfMass On output ioContactPointsOn1/2 are reduced to 4 or less points
inCenterOfMassCenter of mass position of body 1