com.jme.curve
Class PolylineCurve

java.lang.Object
  extended by com.jme.scene.Spatial
      extended by com.jme.scene.Geometry
          extended by com.jme.curve.Curve
              extended by com.jme.curve.PolylineCurve
All Implemented Interfaces:
Savable, java.io.Serializable

public class PolylineCurve
extends Curve

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.scene.Spatial
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode
 
Field Summary
 
Fields inherited from class com.jme.curve.Curve
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
PolylineCurve(java.lang.String name, Vector3f[] controlPoints)
          Constructor instantiates a new PolylineCurve object.
 
Method Summary
 void findCollisions(Spatial scene, CollisionResults results)
          checks this spatial against a second spatial, any collisions are stored in the results object.
 void findPick(Ray toTest, PickResults results)
          Check if this geom intersects the ray if yes add it to the results.
 Matrix3f getOrientation(float time, float precision)
          getOrientation calculates the rotation matrix for any given point along to the line to still be facing in the direction of the line.
 Matrix3f getOrientation(float time, float precision, Vector3f up)
          getOrientation calculates the rotation matrix for any given point along to the line to still be facing in the direction of the line.
 Vector3f getPoint(float time)
          getPoint calculates a point on the curve based on the time, where time is [0, 1].
 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.
 boolean hasCollision(Spatial scene, boolean checkTriangles)
          Checks this spatial against a second spatial for collisions.
 
Methods inherited from class com.jme.curve.Curve
applyRenderState, draw, getSteps, read, setSteps, write
 
Methods inherited from class com.jme.scene.Geometry
addTextureCoordinates, addTextureCoordinates, checkTextureCoordinates, clearBuffers, clearTextureBuffers, copyTextureCoordinates, copyTextureCoordinates, getBinormalBuffer, getColorBuffer, getDefaultColor, getDisplayListID, getFogBuffer, getLightState, getModelBound, getNormalBuffer, getNumberOfUnits, getTangentBuffer, getTextureCoords, getTextureCoords, getTriangleCount, getVBOInfo, getVertexBuffer, getVertexCount, getWorldCoords, getWorldNormals, hasDirtyVertices, isCastsShadows, lockMeshes, postdraw, predraw, randomVertex, reconstruct, resizeTextureIds, rotateNormals, rotatePoints, scaleTextureCoordinates, scaleTextureCoordinates, setBinormalBuffer, setCastsShadows, setColorBuffer, setDefaultColor, setDisplayListID, setFogCoordBuffer, setHasDirtyVertices, setLightState, setModelBound, setNormalBuffer, setRandomColors, setSolidColor, setTangentBuffer, setTextureCoords, setTextureCoords, setTextureCoords, setVBOInfo, setVertexBuffer, setVertexCount, sortLights, translatePoints, translatePoints, unlockMeshes, updateModelBound, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, calculateCollisions, calculatePick, clearControllers, clearRenderState, clearRenderState, getClassTag, getController, getControllerCount, getControllers, getCullHint, getLastFrustumIntersection, getLightCombineMode, getLocalCullHint, getLocalLightCombineMode, getLocalNormalsMode, getLocalRenderQueueMode, getLocalRotation, getLocalScale, getLocalTextureCombineMode, getLocalToWorldMatrix, getLocalTranslation, getLocks, getName, getNormalsMode, getParent, getRenderQueueMode, getRenderState, getRenderState, getTextureCombineMode, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, hasAncestor, isCollidable, localToWorld, lock, lock, lockBounds, lockBranch, lockMeshes, lockShadows, lockTransforms, lookAt, onDraw, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeController, removeFromParent, removeUserData, rotateUpTo, setCullHint, setIsCollidable, setLastFrustumIntersection, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setLocalTranslation, setLocks, setLocks, setName, setNormalsMode, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setUserData, setZOrder, setZOrder, toString, unlock, unlock, unlockBounds, unlockBranch, unlockMeshes, unlockShadows, unlockTransforms, updateGeometricState, updateRenderState, updateRenderState, updateWorldData, updateWorldRotation, updateWorldScale, updateWorldTranslation, updateWorldVectors, updateWorldVectors, worldToLocal
 
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
 

Constructor Detail

PolylineCurve

public PolylineCurve(java.lang.String name,
                     Vector3f[] controlPoints)
Constructor instantiates a new PolylineCurve object. The control points that define the curve are supplied.

Parameters:
name - the name of the scene element. This is required for identification and comparision purposes.
controlPoints - the points that define the curve.
Method Detail

getOrientation

public Matrix3f getOrientation(float time,
                               float precision)
getOrientation calculates the rotation matrix for any given point along to the line to still be facing in the direction of the line.

Specified by:
getOrientation in class Curve
Parameters:
time - the current time (between 0 and 1)
precision - how accurate to (i.e. the next time) to check against.
Returns:
the rotation matrix.
See Also:
Curve.getOrientation(float, float)

getOrientation

public Matrix3f getOrientation(float time,
                               float precision,
                               Vector3f up)
getOrientation calculates the rotation matrix for any given point along to the line to still be facing in the direction of the line. A up vector is supplied, this keep the rotation matrix following the line, but insures the object's up vector is not drastically changed.

Specified by:
getOrientation in class Curve
Parameters:
time - the current time (between 0 and 1)
precision - how accurate to (i.e. the next time) to check against.
up - the up vector to lock.
Returns:
the rotation matrix.
See Also:
Curve.getOrientation(float, float)

getPoint

public Vector3f getPoint(float time)
Description copied from class: Curve
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.

Specified by:
getPoint in class Curve
Parameters:
time - the time frame on the curve, [0, 1].
Returns:
the point on the curve at a specified time.

getPoint

public Vector3f getPoint(float time,
                         Vector3f store)
Description copied from class: Curve
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.

Specified by:
getPoint in class Curve
Parameters:
time - the time frame on the curve: [0, 1].
store - the vector3f object to store the point in.
Returns:
store, after receiving the result.
See Also:
Curve.getPoint(float)

findCollisions

public void findCollisions(Spatial scene,
                           CollisionResults results)
Description copied from class: Spatial
checks this spatial against a second spatial, any collisions are stored in the results object.

Specified by:
findCollisions in class Spatial
Parameters:
scene - the scene to test against.
results - the results of the collisions.

hasCollision

public boolean hasCollision(Spatial scene,
                            boolean checkTriangles)
Description copied from class: Spatial
Checks this spatial against a second spatial for collisions.

Specified by:
hasCollision in class Spatial
Parameters:
scene - the scene to test against.
checkTriangles - check for collisions on triangle accuracy level
Returns:
true if any collision were found

findPick

public void findPick(Ray toTest,
                     PickResults results)
Description copied from class: Geometry
Check if this geom intersects the ray if yes add it to the results.

Overrides:
findPick in class Geometry
Parameters:
toTest - ray to check intersection with. The direction of the ray must be normalized (length 1).
results - result list