- Object
-
- AbstractBounds
-
- All Implemented Interfaces:
Bounds
,Shiftable
,Translatable
- Direct Known Subclasses:
AxisAlignedBounds
public abstract class AbstractBounds extends Object implements Bounds, Translatable
Abstract implementation of theBounds
interface.- Since:
- 1.0.0
- Version:
- 3.2.0
- Author:
- William Bittle
-
-
Constructor Summary
Constructors Constructor Description AbstractBounds()
Default constructor.AbstractBounds(double x, double y)
Optional constructor.AbstractBounds(Vector2 translation)
Optional constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector2
getTranslation()
Returns the translation of the bounds.void
shift(Vector2 shift)
Translates the object to match the given coordinate shift.void
translate(double x, double y)
Translates the object the given amounts in the respective directions.void
translate(Vector2 vector)
Translates the object along the given vector.
-
-
-
Field Detail
-
transform
protected Transform transform
-
-
Constructor Detail
-
AbstractBounds
public AbstractBounds()
Default constructor.
-
AbstractBounds
public AbstractBounds(double x, double y)
Optional constructor.- Parameters:
x
- the initial x translation of the boundsy
- the initial x translation of the bounds
-
AbstractBounds
public AbstractBounds(Vector2 translation)
Optional constructor.- Parameters:
translation
- the initial translation of the bounds
-
-
Method Detail
-
getTranslation
public Vector2 getTranslation()
Description copied from interface:Bounds
Returns the translation of the bounds.- Specified by:
getTranslation
in interfaceBounds
- Returns:
Vector2
-
translate
public void translate(double x, double y)
Description copied from interface:Translatable
Translates the object the given amounts in the respective directions.- Specified by:
translate
in interfaceTranslatable
- Parameters:
x
- the translation in the x directiony
- the translation in the y direction
-
translate
public void translate(Vector2 vector)
Description copied from interface:Translatable
Translates the object along the given vector.- Specified by:
translate
in interfaceTranslatable
- Parameters:
vector
- the translation along a vector
-
-