|
||||||||||
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
public abstract class 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme.scene.Spatial |
---|
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode |
Field Summary | |
---|---|
protected int |
steps
|
Fields inherited from class com.jme.scene.Geometry |
---|
binormalBuf, bound, castsShadows, colorBuf, compVect, defaultColor, displayListID, enabled, fogBuf, hasDirtyVertices, normBuf, states, tangentBuf, texBuf, vboInfo, vertBuf, vertQuantity |
Fields inherited from class com.jme.scene.Spatial |
---|
cullHint, frustrumIntersects, geometricalControllers, isCollidable, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, 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
no points. |
|
Curve(java.lang.String name,
Vector3f[] controlPoints)
Constructor creates a Curve object. |
Method Summary | |
---|---|
protected void |
applyRenderState(java.util.Stack<? extends RenderState>[] states)
applyRenderState determines if a particular render state
is set for this Geometry. |
void |
draw(Renderer r)
draw calls super to set the render state then calls the
renderer to display the curve. |
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 |
read(JMEImporter e)
|
void |
setSteps(int steps)
setSteps sets the number of steps that make up the curve. |
void |
write(JMEExporter e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.jme.util.export.Savable |
---|
getClassTag |
Field Detail |
---|
protected int steps
Constructor Detail |
---|
public Curve(java.lang.String name)
Curve
object with a
no 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. These are copied into the
object, further changes to these Vectors will not affect 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 Geometry
r
- the renderer used to display the curve.Spatial.draw(com.jme.renderer.Renderer)
public 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.
protected void applyRenderState(java.util.Stack<? extends RenderState>[] states)
Geometry
applyRenderState
determines if a particular render state
is set for this Geometry. If not, the default state will be used.
applyRenderState
in class Geometry
states
- An array of stacks for each state.public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class Geometry
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class Geometry
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |