|
||||||||||
| 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.Curve
public class Curve
A beizer curve implementation. The curve is defined by a start point, an end point and two control points that it will tend towards. This is implementation is fixed segmenting meaning it doesn't scale too well.
| Field Summary |
|---|
| Fields inherited from class org.newdawn.slick.geom.Shape |
|---|
boundingCircleRadius, center, maxX, maxY, minX, minY, points, pointsDirty, trianglesDirty, tris, x, y |
| Constructor Summary | |
|---|---|
Curve(Vector2f p1,
Vector2f c1,
Vector2f c2,
Vector2f p2)
Create a new curve with the default segments (20) |
|
Curve(Vector2f p1,
Vector2f c1,
Vector2f c2,
Vector2f p2,
int segments)
Create a new curve |
|
| Method Summary | |
|---|---|
boolean |
closed()
True if this is a closed shape |
protected void |
createPoints()
Subclasses implement this to create the points of the shape. |
Vector2f |
pointAt(float t)
Get the point at a particular location on the curve |
Shape |
transform(Transform transform)
Apply a transformation and return a new shape. |
| Methods inherited from class org.newdawn.slick.geom.Shape |
|---|
calculateRadius, calculateTriangles, checkPoints, contains, contains, findCenter, getBoundingCircleRadius, getCenter, getCenterX, getCenterY, getHeight, getLocation, getMaxX, getMaxY, getMinX, getMinY, getNormal, getPoint, getPointCount, getPoints, getTriangles, getWidth, getX, getY, hasVertex, includes, increaseTriangulation, indexOf, intersects, 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 |
| Constructor Detail |
|---|
public Curve(Vector2f p1,
Vector2f c1,
Vector2f c2,
Vector2f p2)
p1 - The start of the curvec1 - The first control pointc2 - The second control pointp2 - The end of the curve
public Curve(Vector2f p1,
Vector2f c1,
Vector2f c2,
Vector2f p2,
int segments)
p1 - The start of the curvec1 - The first control pointc2 - The second control pointp2 - The end of the curvesegments - The number of segments to use| Method Detail |
|---|
public Vector2f pointAt(float t)
t - A value between 0 and 1 defining the location of the curve the point is at
protected void createPoints()
Shape
createPoints in class ShapeShape.createPoints()public Shape transform(Transform transform)
Shape
transform in class Shapetransform - The transform to be applied
Shape.transform(org.newdawn.slick.geom.Transform)public boolean closed()
closed in class Shape
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||