| Constructor and Description |
|---|
Triangle(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Constructor
|
Triangle(Triangle triangle)
Constructs a
Triangle as a copy of another |
Triangle(com.badlogic.gdx.math.Vector2 v1,
com.badlogic.gdx.math.Vector2 v2,
com.badlogic.gdx.math.Vector2 v3)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(float x,
float y)
Returns if a set of coordinates are contained inside this
Shape |
boolean |
contains(Shape shape)
|
boolean |
contains(com.badlogic.gdx.math.Vector2 vector2)
Returns if a
Vector2 is contained inside this Shape |
Shape |
copy()
Returns an exact copy of this
Shape |
void |
draw(Graphics g)
Draws this shape using a
Graphics instance |
EdgeIterator |
edgeIterator()
Returns an
EdgeIterator for looping over the edges of this
Shape |
boolean |
equals(java.lang.Object obj) |
void |
fill(Graphics g)
Fills this shape using a
Graphics instance |
float |
getCenterX()
Returns the center x coordinate of this object.
|
float |
getCenterY()
Returns the center y coordinate of this object.
|
float |
getDistanceTo(float x,
float y)
Returns the distance from this
Shape to a set of coordinates |
float |
getMaxX()
Returns the right-most x coordinate
|
float |
getMaxY()
Returns the bottom-most y coordinate
|
float |
getMinX()
Returns the left-most x coordinate
|
float |
getMinY()
Returns the top-most y coordinate
|
int |
getNumberOfSides()
Returns the number of edges of this object
|
Polygon |
getPolygon()
|
float |
getRotation()
Returns the rotation of this
Shape |
float |
getX()
Returns the x coordinate of this object
|
float |
getY()
Returns the y coordinate of this object
|
int |
hashCode() |
boolean |
intersects(LineSegment lineSegment)
Returns if this
Shape intersects the specified
LineSegment |
boolean |
intersects(Polygon polygon)
|
boolean |
intersects(Rectangle rectangle)
|
boolean |
intersects(Shape shape)
|
boolean |
intersects(Triangle triangle)
|
boolean |
intersectsLineSegment(float x1,
float y1,
float x2,
float y2)
Returns if this
Shape intersects a line segment |
boolean |
intersectsLineSegment(com.badlogic.gdx.math.Vector2 pointA,
com.badlogic.gdx.math.Vector2 pointB)
Returns if this
Shape intersects a line segment |
boolean |
isCircle()
|
void |
rotate(float degrees)
Rotates this
Shape by a specified amount of degrees with its
first point as the origin |
void |
rotateAround(float centerX,
float centerY,
float degrees)
Rotates this
Shape by a specified amount of degrees around a
specified point |
void |
scale(float scale)
Scales the radius of this shape.
|
void |
set(float x,
float y)
Sets the x and y coordinate of this object
|
void |
setCenter(float x,
float y)
Sets the center x,y coordinate of this object
|
void |
setCenterX(float x)
Sets the center x coordinate
|
void |
setCenterY(float y)
Sets the center y coordianate
|
void |
setPosition(float x1,
float y1,
float x2,
float y2,
float x3,
float y3) |
void |
setRadius(float radius)
Sets the radius of this shape.
|
void |
setRotation(float degrees)
Sets the rotation of this
Shape with its first point as the
origin |
void |
setRotationAround(float centerX,
float centerY,
float degrees)
Sets the rotation of this
Shape with a specified point as the
origin |
void |
setX(float x)
Sets the x coordinate of this object
|
void |
setY(float y)
Sets the y coordinate of this object
|
void |
translate(float translateX,
float translateY)
Translates the x and y coordinate of this object
|
add, getDistanceTo, subtractpublic Triangle(com.badlogic.gdx.math.Vector2 v1,
com.badlogic.gdx.math.Vector2 v2,
com.badlogic.gdx.math.Vector2 v3)
public Triangle(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
public boolean contains(float x,
float y)
ShapeShapepublic boolean contains(com.badlogic.gdx.math.Vector2 vector2)
ShapeVector2 is contained inside this Shapepublic boolean intersects(Shape shape)
Shapeintersects in class Shapeshape - The Shape to checkShape intersects the specified Shapepublic boolean intersects(LineSegment lineSegment)
ShapeShape intersects the specified
LineSegmentintersects in class ShapelineSegment - The LineSegment to checkShape intersects the LineSegmentpublic boolean intersectsLineSegment(com.badlogic.gdx.math.Vector2 pointA,
com.badlogic.gdx.math.Vector2 pointB)
ShapeShape intersects a line segmentintersectsLineSegment in class ShapepointA - The first point in the line segmentpointB - The second point in the line segmentShape intersects the line segmentpublic boolean intersectsLineSegment(float x1,
float y1,
float x2,
float y2)
ShapeShape intersects a line segmentintersectsLineSegment in class Shapex1 - 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 boolean intersects(Polygon polygon)
public boolean intersects(Triangle triangle)
public boolean intersects(Rectangle rectangle)
public void translate(float translateX,
float translateY)
Shapepublic void setRotation(float degrees)
ShapeShape with its first point as the
originsetRotation in class Shapedegrees - The rotation in degreespublic void rotate(float degrees)
ShapeShape by a specified amount of degrees with its
first point as the originpublic int getNumberOfSides()
ShapegetNumberOfSides in class Shapepublic void draw(Graphics g)
ShapeGraphics instancepublic void fill(Graphics g)
ShapeGraphics instancepublic float getDistanceTo(float x,
float y)
ShapeShape to a set of coordinatesgetDistanceTo in class Shapex - The x coordinatey - The y coordinatepublic float getRotation()
ShapeShapegetRotation in class Shapepublic void setRotationAround(float centerX,
float centerY,
float degrees)
ShapeShape with a specified point as the
originsetRotationAround in class ShapecenterX - The origin/center x coordinatecenterY - The origin/center y coordinatedegrees - The rotation in degreespublic void rotateAround(float centerX,
float centerY,
float degrees)
ShapeShape by a specified amount of degrees around a
specified pointrotateAround in class ShapecenterX - The origin/center x coordinatecenterY - The origin/center y coordinatedegrees - The rotation in degreespublic float getX()
Shapepublic void setX(float x)
Shapepublic float getY()
Shapepublic void setY(float y)
Shapepublic void set(float x,
float y)
Shapepublic void setPosition(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
public float getMinX()
Shapepublic float getMinY()
Shapepublic float getMaxX()
Shapepublic float getMaxY()
Shapepublic float getCenterX()
ShapeCircle
this is the same as x.getCenterX in class Shapepublic float getCenterY()
ShapeCircle
this is the same as y.getCenterY in class Shapepublic void setCenter(float x,
float y)
Shapepublic void setCenterX(float x)
ShapesetCenterX in class Shapex - The x coordinate of the shape's centerpublic void setCenterY(float y)
ShapesetCenterY in class Shapey - The y coordinate of the shape's centerpublic void setRadius(float radius)
Shapepublic EdgeIterator edgeIterator()
ShapeEdgeIterator for looping over the edges of this
ShapeedgeIterator in class ShapeEdgeIteratorpublic boolean isCircle()
Shapepublic Polygon getPolygon()
ShapegetPolygon in class ShapeShape is a Circlepublic void scale(float scale)
Shape