|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Geometry
com.jme.curve.Curve
Curve defines a collection of points that make up a curve.
How this curve is constructed is undefined, and the job of a subclass.
The control points are defined as the super class Geometry
vertex array. They can be set and accessed as such.
Curve is abstract only maintaining the point collection. It
defines getPoint and getOrientation. Extending
classes are responsible for implementing these methods in the appropriate
way.
| Field Summary | |
protected int |
steps
|
| Fields inherited from class com.jme.scene.Geometry |
bound, color, colorBuf, normal, normBuf, texBuf, texture, vertBuf, vertex, vertQuantity |
| Fields inherited from class com.jme.scene.Spatial |
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
| Constructor Summary | |
Curve(java.lang.String name)
Constructor creates a default Curve object with a
zero size array for the points. |
|
Curve(java.lang.String name,
Vector3f[] controlPoints)
Constructor creates a Curve object. |
|
| Method Summary | |
void |
draw(Renderer r)
draw calls super to set the render state then calls the
renderer to display the curve. |
void |
drawBounds(Renderer r)
drawBounds calls super to set the render state then passes itself
to the renderer. |
abstract Matrix3f |
getOrientation(float time,
float precision)
getOrientation calculates a rotation matrix that
defines the orientation along a curve. |
abstract Matrix3f |
getOrientation(float time,
float precision,
Vector3f up)
getOrientation calculates a rotation matrix that
defines the orientation along a curve. |
abstract Vector3f |
getPoint(float time)
getPoint calculates a point on the curve based on
the time, where time is [0, 1]. |
abstract Vector3f |
getPoint(float time,
Vector3f store)
Equivalent to getPoint(float) but instead of creating a new Vector3f object on the heap, the result is stored in store and store is returned. |
int |
getSteps()
getSteps retrieves the number of steps that make up the
curve. |
void |
setSteps(int steps)
setSteps sets the number of steps that make up the curve. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int steps
| Constructor Detail |
public Curve(java.lang.String name)
Curve object with a
zero size array for the points.
name - the name of the scene element. This is required for identification and
comparision purposes.
public Curve(java.lang.String name,
Vector3f[] controlPoints)
Curve object. The control
point list is set during creation. If the control point list is
null or has fewer than 2 points, an exception is thrown.
name - the name of the scene element. This is required for identification and
comparision purposes.controlPoints - the points that define the curve.| Method Detail |
public void setSteps(int steps)
setSteps sets the number of steps that make up the curve.
steps - the number of steps that make up the curve.public int getSteps()
getSteps retrieves the number of steps that make up the
curve.
public void draw(Renderer r)
draw calls super to set the render state then calls the
renderer to display the curve.
draw in class Geometryr - the renderer used to display the curve.Spatial.draw(com.jme.renderer.Renderer)public void drawBounds(Renderer r)
drawBounds calls super to set the render state then passes itself
to the renderer.
drawBounds in class Geometryr - the renderer to displaypublic abstract Vector3f getPoint(float time)
getPoint calculates a point on the curve based on
the time, where time is [0, 1]. How the point is calculated is
defined by the subclass.
time - the time frame on the curve, [0, 1].
public abstract Vector3f getPoint(float time,
Vector3f store)
time - the time frame on the curve: [0, 1].store - the vector3f object to store the point in.
getPoint(float)
public abstract Matrix3f getOrientation(float time,
float precision)
getOrientation calculates a rotation matrix that
defines the orientation along a curve. How the matrix is
calculated is defined by the subclass.
time - the time frame on the curve, [0, 1].precision - the accuracy of the orientation (lower is more
precise). Recommended (0.1).
public abstract Matrix3f getOrientation(float time,
float precision,
Vector3f up)
getOrientation calculates a rotation matrix that
defines the orientation along a curve. The up vector is provided
keeping the orientation from "rolling" along the curve. This is
useful for camera tracks. How the matrix is calculated is defined
by the subclass.
time - the time frame on the curve, [0, 1].precision - the accuracy of the orientation (lower is more
precise). Recommended (0.1).up - the up vector to lock.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||