- Object
-
- ClippingManifoldSolver
-
- All Implemented Interfaces:
ManifoldSolver
public class ClippingManifoldSolver extends Object implements ManifoldSolver
Implementation of a Sutherland-Hodgman clippingManifoldSolver
algorithm.A
NarrowphaseDetector
should return a penetration normal and depth when twoConvex
Shape
s are intersecting. The penetration normal should always point from the firstShape
to the second. Using thePenetration
, this class will find the closest features and perform a series of clipping operations to build a contactManifold
.In the case that a
Convex
Shape
returns aPointFeature
Feature
, that feature will always take precedence.It's possible that no contact points are returned, in which case the
getManifold(Penetration, Convex, Transform, Convex, Transform, Manifold)
method will return false.- Since:
- 1.0.0
- Version:
- 3.0.2
- Author:
- William Bittle
- See Also:
- Contact Points Using Clipping
-
-
Constructor Summary
Constructors Constructor Description ClippingManifoldSolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getManifold(Penetration penetration, Convex convex1, Transform transform1, Convex convex2, Transform transform2, Manifold manifold)
-
-
-
Method Detail
-
getManifold
public boolean getManifold(Penetration penetration, Convex convex1, Transform transform1, Convex convex2, Transform transform2, Manifold manifold)
Description copied from interface:ManifoldSolver
Returns true if there exists a valid contact manifold between the twoConvex
Shape
s.When returning true, this method fills in the
Manifold
object with the points, depth, and normal.The given
Manifold
object will be cleared using theManifold.clear()
method. This allows reuse of theManifold
if desired.The
Penetration
object will be left unchanged by this method.- Specified by:
getManifold
in interfaceManifoldSolver
- Parameters:
penetration
- thePenetration
convex1
- the firstConvex
Shape
transform1
- the firstShape
'sTransform
convex2
- the secondConvex
Shape
transform2
- the secondShape
'sTransform
manifold
- theManifold
object to fill- Returns:
- boolean
-
-