|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.physicsEngine.geometry.shapes.JavaShape
public class JavaShape
Shape implementation that uses the java.awt.Shape
framework as
the back-end. This allows support for arbitrary closed shapes.
Field Summary | |
---|---|
java.awt.Shape |
javaShape
|
(package private) double |
r2IntegralRatio
|
Constructor Summary | |
---|---|
JavaShape(java.awt.Shape shape)
Creates a JavaShape from a java.awt.Shape object. |
Method Summary | |
---|---|
java.awt.image.BufferedImage |
createBufferedImage(double angularPosition)
Creates a BufferedImage representing the given
Shape . |
BoundingBox |
getBoundingBox()
Returns the bounding box of a shape. |
Vector2f |
getCentroid()
|
double |
getR2IntegralEstimate()
Obtain an estimate of the integral of R^2 over the whole shape, where R is the distance between each point and the centroid. |
Vector2f |
getSmallestCorner()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.awt.Shape javaShape
final double r2IntegralRatio
Constructor Detail |
---|
public JavaShape(java.awt.Shape shape)
java.awt.Shape
object.
shape
- Method Detail |
---|
public java.awt.image.BufferedImage createBufferedImage(double angularPosition)
Shape
BufferedImage
representing the given
Shape
. This image will have the same bounding box as the
given shape. The image will have black outline and white interior. This
is mostly for simple games and internal testing.
createBufferedImage
in interface Shape
public BoundingBox getBoundingBox()
Shape
getBoundingBox
in interface Shape
public double getR2IntegralEstimate()
Shape
getR2IntegralEstimate
in interface Shape
public Vector2f getCentroid()
getCentroid
in interface Shape
public Vector2f getSmallestCorner()
getSmallestCorner
in interface Shape
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |