public abstract class Shape
extends java.lang.Object
| Constructor and Description |
|---|
Shape() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
contains(float x,
float y)
Returns if a set of coordinates are contained inside this
Shape |
abstract boolean |
contains(Shape shape)
|
abstract boolean |
contains(com.badlogic.gdx.math.Vector2 vector2)
Returns if a
Vector2 is contained inside this Shape |
abstract Shape |
copy()
Returns an exact copy of this
Shape |
abstract void |
draw(Graphics g)
Draws this shape using a
Graphics instance |
abstract EdgeIterator |
edgeIterator()
Returns an
EdgeIterator for looping over the edges of this
Shape |
abstract void |
fill(Graphics g)
Fills this shape using a
Graphics instance |
abstract float |
getDistanceTo(float x,
float y)
Returns the distance from this
Shape to a set of coordinates |
abstract float |
getMaxX()
Returns the right-most x coordinate
|
abstract float |
getMaxY()
Returns the bottom-most y coordinate
|
abstract float |
getMinX()
Returns the left-most x coordinate
|
abstract float |
getMinY()
Returns the top-most y coordinate
|
abstract int |
getNumberOfSides()
Returns the number of edges of this object
|
abstract Polygon |
getPolygon()
|
abstract float |
getRotation()
Returns the rotation of this
Shape |
abstract float |
getX()
Returns the x coordinate of this object
|
abstract float |
getY()
Returns the y coordinate of this object
|
boolean |
intersects(LineSegment lineSegment)
Returns if this
Shape intersects the specified
LineSegment |
abstract boolean |
intersects(Shape shape)
|
abstract boolean |
intersectsLineSegment(float x1,
float y1,
float x2,
float y2)
Returns if this
Shape intersects a line segment |
abstract boolean |
intersectsLineSegment(com.badlogic.gdx.math.Vector2 pointA,
com.badlogic.gdx.math.Vector2 pointB)
Returns if this
Shape intersects a line segment |
abstract boolean |
isCircle()
|
abstract void |
rotate(float degrees)
Rotates this
Shape by a specified amount of degrees with its first point as the origin |
abstract void |
rotateAround(float originX,
float originY,
float degrees)
Rotates this
Shape by a specified amount of degrees around a specified point |
abstract void |
set(float x,
float y)
Sets the x and y coordinate of this object
|
abstract void |
setRotation(float degrees)
Sets the rotation of this
Shape with its first point as the origin |
abstract void |
setRotationAround(float originX,
float originY,
float degrees)
Sets the rotation of this
Shape with a specified point as the origin |
abstract void |
setX(float x)
Sets the x coordinate of this object
|
abstract void |
setY(float y)
Sets the y coordinate of this object
|
abstract void |
translate(float translateX,
float translateY)
Translates the x and y coordinate of this object
|
public abstract Shape copy()
ShapeShapepublic abstract boolean contains(float x,
float y)
Shapex - The x coordinate to checky - The y coordinate to checkShape contains the specified coordinatespublic abstract boolean contains(com.badlogic.gdx.math.Vector2 vector2)
Vector2 is contained inside this Shapevector2 - The Vector2 to checkShape contains the specified Vector2public abstract boolean contains(Shape shape)
public boolean intersects(LineSegment lineSegment)
Shape intersects the specified
LineSegmentlineSegment - The LineSegment to checkShape intersects the LineSegmentpublic abstract boolean intersectsLineSegment(com.badlogic.gdx.math.Vector2 pointA,
com.badlogic.gdx.math.Vector2 pointB)
Shape intersects a line segmentpointA - The first point in the line segmentpointB - The second point in the line segmentShape intersects the line segmentpublic abstract boolean intersectsLineSegment(float x1,
float y1,
float x2,
float y2)
Shape intersects a line segmentx1 - The x coordinate of the first pointy1 - The y coordinate of the first pointx2 - The x coordinate of the second pointy2 - The y coordinate of the second pointShape intersects the line segmentpublic abstract boolean intersects(Shape shape)
public abstract float getDistanceTo(float x,
float y)
Shape to a set of coordinatesx - The x coordinatey - The y coordinatepublic abstract float getRotation()
Shapepublic abstract void setRotation(float degrees)
Shape with its first point as the origindegrees - The rotation in degreespublic abstract void setRotationAround(float originX,
float originY,
float degrees)
Shape with a specified point as the originoriginX - The origin/center x coordinateoriginY - The origin/center y coordinatedegrees - The rotation in degreespublic abstract void rotate(float degrees)
Shape by a specified amount of degrees with its first point as the origindegrees - The rotation in degreespublic abstract void rotateAround(float originX,
float originY,
float degrees)
Shape by a specified amount of degrees around a specified pointoriginX - The origin/center x coordinateoriginY - The origin/center y coordinatedegrees - The rotation in degreespublic abstract void draw(Graphics g)
Graphics instanceg - The Graphics context to render withpublic abstract void fill(Graphics g)
Graphics instanceg - The Graphics context to render withpublic abstract float getX()
public abstract float getY()
public abstract void setX(float x)
x - The x coordinatepublic abstract void setY(float y)
y - The y coordinatepublic abstract void set(float x,
float y)
x - The x coordinatey - The y coordinatepublic abstract float getMinX()
public abstract float getMinY()
public abstract float getMaxX()
public abstract float getMaxY()
public abstract void translate(float translateX,
float translateY)
translateX - The x translation amounttranslateY - The y translation amountpublic abstract int getNumberOfSides()
public abstract EdgeIterator edgeIterator()
EdgeIterator for looping over the edges of this
ShapeEdgeIterator