|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.newdawn.slick.geom.Shape
org.newdawn.slick.geom.Ellipse
org.newdawn.slick.geom.Circle
public class Circle
A simple Circle geometry
| Field Summary | |
|---|---|
float |
radius
The radius of the circle |
| Fields inherited from class org.newdawn.slick.geom.Ellipse |
|---|
DEFAULT_SEGMENT_COUNT |
| Fields inherited from class org.newdawn.slick.geom.Shape |
|---|
boundingCircleRadius, center, maxX, maxY, minX, minY, points, pointsDirty, trianglesDirty, tris, x, y |
| Constructor Summary | |
|---|---|
Circle(float centerPointX,
float centerPointY,
float radius)
Create a new circle based on its radius |
|
Circle(float centerPointX,
float centerPointY,
float radius,
int segmentCount)
Create a new circle based on its radius |
|
| Method Summary | |
|---|---|
protected void |
calculateRadius()
Calculate the radius of a circle that can completely enclose this shape. |
boolean |
contains(float x,
float y)
Check if a point is contained by this circle |
protected void |
findCenter()
Get the center of this polygon. |
float[] |
getCenter()
Get the coordinates of the center of the circle |
float |
getCenterX()
Get the x coordinate of the centre of the circle |
float |
getCenterY()
Get the y coordinate of the centre of the circle |
float |
getRadius()
Get the radius of the circle |
boolean |
intersects(Shape shape)
Check if this circle touches another |
void |
setRadius(float radius)
Set the radius of this circle |
| Methods inherited from class org.newdawn.slick.geom.Ellipse |
|---|
createPoints, getRadius1, getRadius2, setRadii, setRadius1, setRadius2, transform |
| Methods inherited from class org.newdawn.slick.geom.Shape |
|---|
calculateTriangles, checkPoints, closed, contains, getBoundingCircleRadius, getHeight, getLocation, getMaxX, getMaxY, getMinX, getMinY, getNormal, getPoint, getPointCount, getPoints, getTriangles, getWidth, getX, getY, hasVertex, includes, increaseTriangulation, indexOf, preCache, prune, setCenterX, setCenterY, setLocation, setLocation, setX, setY, subtract, union |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public float radius
| Constructor Detail |
|---|
public Circle(float centerPointX,
float centerPointY,
float radius)
centerPointX - The x location of the center of the circlecenterPointY - The y location of the center of the circleradius - The radius of the circle
public Circle(float centerPointX,
float centerPointY,
float radius,
int segmentCount)
centerPointX - The x location of the center of the circlecenterPointY - The y location of the center of the circleradius - The radius of the circlesegmentCount - The number of segments to build the circle out of| Method Detail |
|---|
public float getCenterX()
getCenterX in class Shapepublic float getCenterY()
getCenterY in class Shapepublic float[] getCenter()
getCenter in class Shapepublic void setRadius(float radius)
radius - The radius of this circlepublic float getRadius()
public boolean intersects(Shape shape)
intersects in class Shapeshape - The other circle
public boolean contains(float x,
float y)
contains in class Shapex - The x coordinate of the point to checky - The y coorindate of the point to check
protected void findCenter()
Shape
findCenter in class EllipseEllipse.findCenter()protected void calculateRadius()
Shape
calculateRadius in class EllipseEllipse.calculateRadius()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||