Module org.dyn4j

## Class Separation

• All Implemented Interfaces:
`Copyable<Separation>`, `Shiftable`

```public class Separation
extends Object
implements Shiftable, Copyable<Separation>```
Represents a `Separation` of one `Convex` `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
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 given `Separation` information to this `Separation`.
`double` `getDistance()`
Returns the separation distance.
`Vector2` `getNormal()`
Returns the separation normal.
`Vector2` `getPoint1()`
Returns the closest point on the first `Convex` `Shape`.
`Vector2` `getPoint2()`
Returns the closest point on the second `Convex` `Shape`.
`void` `setDistance​(double distance)`
Sets the separation distance.
`void` `setNormal​(Vector2 normal)`
Sets the separation normal.
`void` `setPoint1​(Vector2 point1)`
Sets the closest point on the first `Convex` `Shape`.
`void` `setPoint2​(Vector2 point2)`
Sets the closest point on the second `Convex` `Shape`.
`void` `shift​(Vector2 shift)`
Translates the object to match the given coordinate shift.
`String` `toString()`
• ### Methods inherited from class Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
• ### Constructor Detail

• #### Separation

`public Separation()`
Default constructor.
• ### Method Detail

• #### toString

`public String toString()`
Overrides:
`toString` in class `Object`
• #### clear

`public void clear()`
Clears the separation information.
• #### getNormal

`public Vector2 getNormal()`
Returns the separation normal.
Returns:
`Vector2`
• #### 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
• #### copy

`public void copy​(Separation separation)`
Copies (deep) the given `Separation` information to this `Separation`.
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.
Specified by:
`shift` in interface `Shiftable`
Parameters:
`shift` - the amount to shift along the x and y axes
• #### copy

`public Separation copy()`
Description copied from interface: `Copyable`
Returns a deep copy of this object.
Specified by:
`copy` in interface `Copyable<Separation>`
Returns:
T