com.jme3.scene.shape
Class Curve

java.lang.Object
  extended by com.jme3.scene.Mesh
      extended by com.jme3.scene.shape.Curve
All Implemented Interfaces:
Savable, java.lang.Cloneable

public class Curve
extends Mesh

A Curve is a visual, line-based representation of a Spline. The underlying Spline will be sampled N times where N is the number of segments as specified in the constructor. Each segment will represent one line in the generated mesh.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme3.scene.Mesh
Mesh.Mode
 
Constructor Summary
Curve()
          Serialization only.
Curve(Spline spline, int nbSubSegments)
          Create a curve mesh from a Spline
Curve(Vector3f[] controlPoints, int nbSubSegments)
          Create a curve mesh.
 
Method Summary
 float getLength()
          This method returns the length of the curve.
 
Methods inherited from class com.jme3.scene.Mesh
clearBuffer, clone, cloneForAnim, collideWith, createCollisionData, deepClone, extractVertexData, generateBindPose, getBound, getBuffer, getBufferList, getBuffers, getElementLengths, getFloatBuffer, getId, getIndexBuffer, getIndicesAsList, getLineWidth, getLodLevel, getMaxNumWeights, getMode, getModeStart, getNumLodLevels, getPointSize, getShortBuffer, getTriangle, getTriangle, getTriangle, getTriangleCount, getTriangleCount, getVertexCount, prepareForAnim, read, scaleTextureCoordinates, setBound, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setDynamic, setElementLengths, setId, setInterleaved, setLineWidth, setLodLevels, setMaxNumWeights, setMode, setModeStart, setPointSize, setStatic, setStreamed, updateBound, updateCounts, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Curve

public Curve()
Serialization only. Do not use.


Curve

public Curve(Vector3f[] controlPoints,
             int nbSubSegments)
Create a curve mesh. Use a CatmullRom spline model that does not cycle.

Parameters:
controlPoints - the control points to use to create this curve
nbSubSegments - the number of subsegments between the control points

Curve

public Curve(Spline spline,
             int nbSubSegments)
Create a curve mesh from a Spline

Parameters:
spline - the spline to use
nbSubSegments - the number of subsegments between the control points
Method Detail

getLength

public float getLength()
This method returns the length of the curve.

Returns:
the length of the curve