|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.jgamegrid.GGCircle
public class GGCircle
Class representing a circle in the x-y-plane with a center vector and a radius (all doubles).
Field Summary | |
---|---|
GGVector |
center
The public vector to the center of the circle. |
double |
radius
The public radius of the circle. |
Constructor Summary | |
---|---|
GGCircle()
Constructs a circle at (0, 0) with radius = 0. |
|
GGCircle(double radius)
Constructs a circle at (0, 0) with given radius. |
|
GGCircle(GGCircle circle)
Constructs a new circle with the same center and radius as the given circle. |
|
GGCircle(GGVector center,
double radius)
Constructs a circle with given center and radius. |
Method Summary | |
---|---|
GGCircle |
clone()
Returns a new circle with the same center and radius as the current circle. |
GGVector |
getCenter()
Returns a copy of the center of the circle. |
double |
getRadius()
Returns the radius of the circle. |
boolean |
isEqual(GGCircle circle)
Returns true, if the current circle is identical to the given circle. |
boolean |
isIntersecting(GGCircle circle)
Returns true if the current circle intersects with the given circle. |
boolean |
isIntersecting(GGRectangle rect)
Returns true if the current circle intersects with the given rectangle. |
boolean |
isIntersecting(GGVector vector)
Returns true if the given points is part of the circle area. |
boolean |
isIntersecting(GGVector imageCenter,
double imageDirection,
java.awt.image.BufferedImage image,
boolean isRotatable)
Returns true, if area of the current circle intersects the non-transparant area of the given image. |
boolean |
isIntersecting(java.awt.Rectangle rect)
Returns true if the current circle intersects with the given java.awt.Rectangle. |
java.lang.String |
toString()
Returns a string that enumerates center and radius. |
void |
translate(GGVector v)
Performs a translation by the given vector. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public GGVector center
public double radius
Constructor Detail |
---|
public GGCircle(GGVector center, double radius)
center
- the vector to the centerradius
- the radius of the circlepublic GGCircle(double radius)
radius
- the radius of the circlepublic GGCircle()
public GGCircle(GGCircle circle)
circle
- the circle from where center and radius are copied.Method Detail |
---|
public double getRadius()
public GGVector getCenter()
public GGCircle clone()
clone
in class java.lang.Object
public void translate(GGVector v)
v
- the translation vectorpublic boolean isIntersecting(GGCircle circle)
circle
- the circle to be checked for intersection with the current circle
public boolean isIntersecting(GGRectangle rect)
rect
- the rectangle to be checked for intersection with the current circle
public boolean isIntersecting(java.awt.Rectangle rect)
rect
- the rectangle to be checked for intersection with the current circle
public boolean isIntersecting(GGVector vector)
vector
- the vector to be checked for intersection
public boolean isIntersecting(GGVector imageCenter, double imageDirection, java.awt.image.BufferedImage image, boolean isRotatable)
imageCenter
- the vector to the center of the imageimageDirection
- the direction of the image (angle of edge ulx --> uly
with respect to the positive x-direction (0..2*pi))image
- the buffered imageisRotatable
- if true, the imageDirection is considered; otherwise
imageDirection = 0 is assumedpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean isEqual(GGCircle circle)
circle
- the cirle to compare
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |