- Object
-
- Separation
-
- All Implemented Interfaces:
Copyable<Separation>
,Shiftable
public class Separation extends Object implements Shiftable, Copyable<Separation>
Represents aSeparation
of oneConvex
Shape
between another.The separation normal should always be normalized.
- Since:
- 1.0.0
- Version:
- 4.0.0
- Author:
- William Bittle
-
-
Constructor Summary
Constructors Constructor Description Separation()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the separation information.Separation
copy()
Returns a deep copy of this object.void
copy(Separation separation)
Copies (deep) the givenSeparation
information to thisSeparation
.double
getDistance()
Returns the separation distance.Vector2
getNormal()
Returns the separation normal.Vector2
getPoint1()
Vector2
getPoint2()
void
setDistance(double distance)
Sets the separation distance.void
setNormal(Vector2 normal)
Sets the separation normal.void
setPoint1(Vector2 point1)
void
setPoint2(Vector2 point2)
void
shift(Vector2 shift)
Translates the object to match the given coordinate shift.String
toString()
-
-
-
Method Detail
-
clear
public void clear()
Clears the separation information.
-
getDistance
public double getDistance()
Returns the separation distance.- Returns:
- double
-
setNormal
public void setNormal(Vector2 normal)
Sets the separation normal.Must be normalized.
- Parameters:
normal
- the separation normal
-
setDistance
public void setDistance(double distance)
Sets the separation distance.- Parameters:
distance
- the separation distance
-
setPoint1
public void setPoint1(Vector2 point1)
-
setPoint2
public void setPoint2(Vector2 point2)
-
copy
public void copy(Separation separation)
Copies (deep) the givenSeparation
information to thisSeparation
.- Parameters:
separation
- the separation 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 Separation copy()
Description copied from interface:Copyable
Returns a deep copy of this object.- Specified by:
copy
in interfaceCopyable<Separation>
- Returns:
- T
-
-