com.jme.scene.shape
Class Extrusion

java.lang.Object
  extended by com.jme.scene.Spatial
      extended by com.jme.scene.Geometry
          extended by com.jme.scene.TriMesh
              extended by com.jme.scene.shape.Extrusion
All Implemented Interfaces:
Savable, java.io.Serializable

public class Extrusion
extends TriMesh

An extrusion of a 2D object (Line) along a path (List of Vector3f). Either a convenience constructor can be used or the updateGeometry(com.jme.scene.Line, java.util.List, com.jme.math.Vector3f) method. It is also capable of doing a cubic spline interpolation for a list of supporting points

Author:
Irrisor
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.scene.TriMesh
TriMesh.Mode
 
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.scene.TriMesh
indexBuffer, mode, triangleQuantity
 
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
Extrusion()
          Default Constructor.
Extrusion(Line shape, java.util.List<Vector3f> path, Vector3f up)
          Convenience constructor.
Extrusion(java.lang.String name)
          Creates an empty named Extrusion.
Extrusion(java.lang.String name, Line shape, java.util.List<Vector3f> path, Vector3f up)
          Convenience constructor.
 
Method Summary
 void updateGeometry(Line shape, java.util.List<Vector3f> path, boolean closed, Vector3f up)
          Update vertex, color, index and texture buffers (0) to contain an extrusion of shape along path.
 void updateGeometry(Line shape, java.util.List<Vector3f> points, int segments, boolean closed, Vector3f up)
          Performs cubic spline interpolation to find a path through the supporting points where the second derivative is zero.
 void updateGeometry(Line shape, java.util.List<Vector3f> points, int segments, Vector3f up)
          Performs cubic spline interpolation to find a path through the supporting points where the second derivative is zero.
 void updateGeometry(Line shape, java.util.List<Vector3f> path, Vector3f up)
          Update vertex, color, index and texture buffers (0) to contain an extrusion of shape along path.
 
Methods inherited from class com.jme.scene.TriMesh
clearBuffers, draw, findCollisions, findTriangleCollision, findTrianglePick, getIndexBuffer, getMaxIndex, getMeshAsTriangles, getMeshAsTrianglesVertices, getMode, getTriangle, getTriangle, getTriangleCount, getTriangleIndices, getVertIndex, hasCollision, hasTriangleCollision, randomPointOnTriangles, read, recalcTriangleQuantity, reconstruct, setIndexBuffer, setMode, setTriangleQuantity, write
 
Methods inherited from class com.jme.scene.Geometry
addTextureCoordinates, addTextureCoordinates, applyRenderState, checkTextureCoordinates, clearTextureBuffers, copyTextureCoordinates, copyTextureCoordinates, findPick, getBinormalBuffer, getColorBuffer, getDefaultColor, getDisplayListID, getFogBuffer, getLightState, getModelBound, getNormalBuffer, getNumberOfUnits, getTangentBuffer, getTextureCoords, getTextureCoords, 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

Extrusion

public Extrusion()
Default Constructor. Creates an empty Extrusion.

See Also:
updateGeometry(Line, List, Vector3f), updateGeometry(Line, List, boolean, Vector3f), updateGeometry(Line, List, int, Vector3f), updateGeometry(Line, List, int, boolean, Vector3f)

Extrusion

public Extrusion(java.lang.String name)
Creates an empty named Extrusion.

Parameters:
name - name
See Also:
updateGeometry(Line, List, Vector3f), updateGeometry(Line, List, boolean, Vector3f), updateGeometry(Line, List, int, Vector3f), updateGeometry(Line, List, int, boolean, Vector3f)

Extrusion

public Extrusion(Line shape,
                 java.util.List<Vector3f> path,
                 Vector3f up)
Convenience constructor. Calls updateGeometry(Line, List, Vector3f).

Parameters:
shape - see updateGeometry(Line, List, Vector3f)
path - see updateGeometry(Line, List, Vector3f)
up - up vector

Extrusion

public Extrusion(java.lang.String name,
                 Line shape,
                 java.util.List<Vector3f> path,
                 Vector3f up)
Convenience constructor. Sets the name and calls updateGeometry(Line, List, Vector3f).

Parameters:
name - name
shape - see updateGeometry(Line, List, Vector3f)
path - see updateGeometry(Line, List, Vector3f)
up - up vector
Method Detail

updateGeometry

public void updateGeometry(Line shape,
                           java.util.List<Vector3f> path,
                           Vector3f up)
Update vertex, color, index and texture buffers (0) to contain an extrusion of shape along path.

Parameters:
shape - an instance of Line that describes the 2D shape
path - a list of vectors that describe the path the shape should be extruded
up - up vector

updateGeometry

public void updateGeometry(Line shape,
                           java.util.List<Vector3f> path,
                           boolean closed,
                           Vector3f up)
Update vertex, color, index and texture buffers (0) to contain an extrusion of shape along path.

Parameters:
shape - an instance of Line that describes the 2D shape
path - a list of vectors that describe the path the shape should be extruded
closed - true to connect first and last point
up - up vector

updateGeometry

public void updateGeometry(Line shape,
                           java.util.List<Vector3f> points,
                           int segments,
                           Vector3f up)
Performs cubic spline interpolation to find a path through the supporting points where the second derivative is zero. Then calls updateGeometry(Line, List, Vector3f) with this path.

Parameters:
shape - an instance of Line that describes the 2D shape
points - a list of supporting points for the spline interpolation
segments - number of resulting path segments per supporting point
up - up vector

updateGeometry

public void updateGeometry(Line shape,
                           java.util.List<Vector3f> points,
                           int segments,
                           boolean closed,
                           Vector3f up)
Performs cubic spline interpolation to find a path through the supporting points where the second derivative is zero. Then calls updateGeometry(Line, List, boolean, Vector3f) with this path.

Parameters:
shape - an instance of Line that describes the 2D shape
points - a list of supporting points for the spline interpolation
segments - number of resulting path segments per supporting point
closed - true to close the shape (connect last and first point)
up - up vector