|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.geom.GeomUtil
public class GeomUtil
A set of utilities to play with geometry
Nested Class Summary | |
---|---|
class |
GeomUtil.HitResult
A lightweigtht description of a intersection between a shape and line. |
Field Summary | |
---|---|
float |
EDGE_SCALE
The tolerance for determining direction change |
float |
EPSILON
The tolerance for determining changes and steps |
GeomUtilListener |
listener
The listener to notify of operations |
int |
MAX_POINTS
The maximum number of points returned by an operation - prevents full lockups |
Constructor Summary | |
---|---|
GeomUtil()
|
Method Summary | |
---|---|
Line |
getLine(Shape shape,
float sx,
float sy,
int e)
Get a line between two points in a shape |
Line |
getLine(Shape shape,
int s,
int e)
Get a line between two points in a shape |
GeomUtil.HitResult |
intersect(Shape shape,
Line line)
Intersect a line with a shape |
static int |
rationalPoint(Shape shape,
int p)
Rationalise a point in terms of a given shape |
void |
setListener(GeomUtilListener listener)
Set the listener to be notified of geometry based operations |
Shape[] |
subtract(Shape target,
Shape missing)
Subtract one shape from another - note this is experimental and doesn't currently handle islands |
Shape[] |
union(Shape target,
Shape other)
Join to shapes together. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float EPSILON
public float EDGE_SCALE
public int MAX_POINTS
public GeomUtilListener listener
Constructor Detail |
---|
public GeomUtil()
Method Detail |
---|
public Shape[] subtract(Shape target, Shape missing)
target
- The target to be subtracted frommissing
- The shape to subtract
public void setListener(GeomUtilListener listener)
listener
- The listener to be notified of geometry based operationspublic Shape[] union(Shape target, Shape other)
target
- The target shape to union withother
- The additional shape to union
public GeomUtil.HitResult intersect(Shape shape, Line line)
shape
- The shape to compareline
- The line to intersect against the shape
public static int rationalPoint(Shape shape, int p)
shape
- The shapep
- The index of the point
public Line getLine(Shape shape, int s, int e)
shape
- The shapes
- The index of the start pointe
- The index of the end point
public Line getLine(Shape shape, float sx, float sy, int e)
shape
- The shapesx
- The x coordinate of the start pointsy
- The y coordinate of the start pointe
- The index of the end point
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |