Package com.ardor3d.extension.useful
Class TrailMesh
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Mesh
com.ardor3d.extension.useful.TrailMesh
- All Implemented Interfaces:
Pickable
,Hintable
,Renderable
,Savable
TrailMesh
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
class
Storage for each section in the trailmesh.static enum
-
Field Summary
Fields inherited from class com.ardor3d.scenegraph.Mesh
_defaultColor, _isVisible, _lightState, _meshData, _modelBound, _states, RENDER_VERTEX_ONLY
Fields inherited from class com.ardor3d.scenegraph.Spatial
_controllers, _delegateMap, _dirtyMark, _frustumIntersects, _listener, _localTransform, _name, _parent, _queueDistance, _renderStateList, _sceneHints, _userData, _worldBound, _worldTransform, ON_DIRTY_ATTACHED, ON_DIRTY_BOUNDING, ON_DIRTY_RENDERSTATE, ON_DIRTY_TRANSFORM, ON_DIRTY_TRANSFORM_ONLY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the mesh data to modify it manually.float
void
void
read
(InputCapsule capsule) void
resetPosition
(ReadOnlyVector3 position) void
setFacingMode
(TrailMesh.FacingMode facingMode) void
setTrailFront
(ReadOnlyVector3 position, ReadOnlyVector3 tangent, double width, double tpf) Update the front position of the trail.void
setTrailFront
(Vector3 position, float width, float tpf) Update the front position of the trail.void
setUpdateMode
(TrailMesh.UpdateMode updateMode) void
setUpdateSpeed
(float updateSpeed) void
update
(ReadOnlyVector3 camPos) Update the vertices of the trail.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.scenegraph.Mesh
applyWorldRenderStates, draw, getClassTag, getDefaultColor, getLightState, getMeshData, getModelBound, getModelBound, getWorldNormals, getWorldRenderState, getWorldVectors, intersectsPrimitivesWhere, intersectsWorldBound, intersectsWorldBoundsWhere, isVisible, makeCopy, makeInstanced, render, render, renderArrays, renderVBO, reorderIndices, reorderVertexData, reorderVertexData, setDefaultColor, setDefaultColor, setLightState, setMeshData, setModelBound, setModelBound, setRandomColors, setSolidColor, setVisible, sortLights, supportsBoundsIntersectionRecord, supportsPrimitivesIntersectionRecord, updateModelBound, updateWorldBound
Methods inherited from class com.ardor3d.scenegraph.Spatial
acceptVisitor, addController, addTranslation, addTranslation, clearControllers, clearDirty, clearDirty, clearRenderState, getController, getControllerCount, getControllers, getCurrentRenderDelegate, getLastFrustumIntersection, getListener, getLocalLastFrustumIntersection, getLocalRenderState, getLocalRenderStates, getName, getParent, getParentHintable, getRenderDelegate, getRotation, getScale, getSceneHints, getTransform, getTranslation, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, isDirty, localToWorld, markDirty, markDirty, onDraw, propagateBoundToRoot, propagateDirtyDown, propagateDirtyUp, propagateStatesFromRoot, propageEventUp, removeController, removeController, removeFromParent, setLastFrustumIntersection, setListener, setName, setParent, setRenderDelegate, setRenderState, setRotation, setRotation, setScale, setScale, setScale, setTransform, setTranslation, setTranslation, setUserData, setWorldRotation, setWorldRotation, setWorldScale, setWorldScale, setWorldScale, setWorldTransform, setWorldTranslation, setWorldTranslation, toString, updateChildren, updateControllers, updateGeometricState, updateGeometricState, updateWorldRenderStates, updateWorldRenderStates, updateWorldTransform, worldToLocal
-
Constructor Details
-
TrailMesh
Creates a new TrailMesh.- Parameters:
name
- Name of SpatialnrTrailSections
- Number of sections the TrailMesh should consist of. Number of vertices in the mesh will be nrTrailSections * 2.
-
-
Method Details
-
setTrailFront
Update the front position of the trail.- Parameters:
position
- New position of the trail frontwidth
- Width of the trailtpf
- Current time per frame
-
setTrailFront
public void setTrailFront(ReadOnlyVector3 position, ReadOnlyVector3 tangent, double width, double tpf) Update the front position of the trail.- Parameters:
position
- New position of the trail fronttangent
- Specifies the gradient of the trail (if facingmode is set to tangent)width
- Width of the trailtpf
- Current time per frame
-
update
Update the vertices of the trail.- Parameters:
camPos
- Camera position used for billboarding.
-
invalidate
public void invalidate() -
resetPosition
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classMesh
- Parameters:
capsule
- the capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classMesh
- Parameters:
capsule
- the input capsule- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-
setUpdateSpeed
public void setUpdateSpeed(float updateSpeed) -
getUpdateSpeed
public float getUpdateSpeed() -
setUpdateMode
-
getUpdateMode
-
setFacingMode
-
getFacingMode
-
getTrailData
Get the mesh data to modify it manually. If data is modified, invalidate() method call is required.- Returns:
- the mesh data
-