- Object
-
- ManifoldPoint
-
- All Implemented Interfaces:
Copyable<ManifoldPoint>
,Shiftable
public class ManifoldPoint extends Object implements Shiftable, Copyable<ManifoldPoint>
Represents a single contact point in a contactManifold
.The depth represents the distance along the
Manifold
normal to this contact point. This can vary for everyManifoldPoint
in aManifold
.- Since:
- 1.0.0
- Version:
- 4.0.0
- Author:
- William Bittle
- See Also:
Manifold
-
-
Constructor Summary
Constructors Constructor Description ManifoldPoint(ManifoldPointId id)
Optional constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManifoldPoint
copy()
Returns a deep copy of this object.void
copy(ManifoldPoint manifoldPoint)
Copies (deep) the givenManifoldPoint
to thisManifoldPoint
.double
getDepth()
Returns the collision depth of the manifold point.ManifoldPointId
getId()
Returns the id for this manifold point.Vector2
getPoint()
Returns the contact point.void
setDepth(double depth)
Sets the collision depth of the manifold point.void
setPoint(Vector2 point)
Sets the contact point.void
shift(Vector2 shift)
Translates the object to match the given coordinate shift.String
toString()
-
-
-
Constructor Detail
-
ManifoldPoint
public ManifoldPoint(ManifoldPointId id)
Optional constructor.- Parameters:
id
- the id for this manifold point; cannot be null
-
-
Method Detail
-
getId
public ManifoldPointId getId()
Returns the id for this manifold point.- Returns:
ManifoldPointId
-
getPoint
public Vector2 getPoint()
Returns the contact point.- Returns:
Vector2
the point in world coordinates
-
setPoint
public void setPoint(Vector2 point)
Sets the contact point.- Parameters:
point
- the point in world coordinates- Since:
- 3.1.5
-
getDepth
public double getDepth()
Returns the collision depth of the manifold point.- Returns:
- double
-
setDepth
public void setDepth(double depth)
Sets the collision depth of the manifold point.- Parameters:
depth
- the depth- Since:
- 3.1.5
-
copy
public void copy(ManifoldPoint manifoldPoint)
Copies (deep) the givenManifoldPoint
to thisManifoldPoint
.- Parameters:
manifoldPoint
- the manifold point to copy- Since:
- 4.0.0
-
shift
public void shift(Vector2 shift)
Description copied from interface:Shiftable
Translates the object to match the given coordinate shift.
-
copy
public ManifoldPoint copy()
Description copied from interface:Copyable
Returns a deep copy of this object.- Specified by:
copy
in interfaceCopyable<ManifoldPoint>
- Returns:
- T
-
-