Go to the documentation of this file.
29 #ifndef __RibbonTrail_H__
30 #define __RibbonTrail_H__
84 bool useTextureCoords =
true,
bool useVertexColours =
true);
void setNumberOfChains(size_t numChains)
Set the number of chain segments (this class can render multiple chains at once using the same materi...
virtual void addNode(Node *n)
Add a node to be tracked.
ConstVectorIterator< NodeList > NodeIterator
virtual void setColourChange(size_t chainIndex, Real r, Real g, Real b, Real a)
Enables / disables fading the trail using colour.
NodeToChainSegmentMap mNodeToSegMap
void clearChain(size_t chainIndex)
Remove all elements of a given chain (but leave the chain intact).
void nodeDestroyed(const Node *node)
map< const Node *, size_t >::type NodeToChainSegmentMap
virtual void setTrailLength(Real len)
Set the length of the trail.
RibbonTrail(const String &name, size_t maxElements=20, size_t numberOfChains=1, bool useTextureCoords=true, bool useVertexColours=true)
Constructor (don't use directly, use factory)
void setMaxChainElements(size_t maxElements)
Set the maximum number of chain elements per chain.
Abstract class defining a movable object in a scene.
Controller< Real > * mFadeController
controller used to hook up frame time to fader
virtual const ColourValue & getColourChange(size_t chainIndex) const
Get the per-second fading amount.
virtual const ColourValue & getInitialColour(size_t chainIndex) const
Get the starting ribbon colour.
Interface definition for a factory class which produces a certain kind of MovableObject,...
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
void destroyInstance(MovableObject *obj)
Destroy an instance of the object.
ControllerValueRealPtr mTimeControllerValue
controller value for hooking up frame time to fader
IndexVector mNodeToChainSegment
Ordered like mNodeList, contains chain index.
Subclass of BillboardChain which automatically leaves a trail behind one or more Node instances.
virtual Real getInitialWidth(size_t chainIndex) const
Get the starting ribbon width in world units.
Real mElemLength
length of each element
Listener which gets called back on Node events.
RealList mInitialWidth
Initial width of the ribbon.
vector< size_t >::type IndexVector
Mapping of nodes to chain segments.
vector< Node * >::type NodeList
virtual void resetAllTrails(void)
Reset all tracked chains to initial state.
ColourValueList mDeltaColour
fade amount per second
virtual void setInitialColour(size_t chainIndex, Real r, Real g, Real b, Real a=1.0)
Set the starting ribbon colour.
virtual void resetTrail(size_t index, const Node *node)
Reset the tracked chain to initial state.
NodeList mNodeList
List of nodes being trailed.
virtual Real getTrailLength(void) const
Get the length of the trail.
Real mSquaredElemLength
Squared length of each element.
MovableObject * createInstanceImpl(const String &name, const NameValuePairList *params)
Internal implementation of create method - must be overridden.
virtual void setInitialWidth(size_t chainIndex, Real width)
Set the starting ribbon width in world units.
virtual Real getWidthChange(size_t chainIndex) const
Get the change in ribbon width per second.
Class representing colour.
virtual void manageController(void)
Manage updates to the time controller.
virtual void setInitialColour(size_t chainIndex, const ColourValue &col)
Set the starting ribbon colour for a given segment.
virtual NodeIterator getNodeIterator(void) const
Get an iterator over the nodes which are being tracked.
vector< ColourValue >::type ColourValueList
virtual void setColourChange(size_t chainIndex, const ColourValue &valuePerSecond)
Enables / disables fading the trail using colour.
virtual ~RibbonTrail()
destructor
static String FACTORY_TYPE_NAME
const String & getType(void) const
Get the type of the object to be created.
vector< Real >::type RealList
virtual void removeNode(Node *n)
Remove tracking on a given node.
float Real
Software floating point type.
virtual void _timeUpdate(Real time)
Perform any fading / width delta required; internal method.
RealList mDeltaWidth
Delta width of the ribbon.
Allows the rendering of a chain of connected billboards.
ColourValueList mInitialColour
Initial colour of the ribbon.
virtual void updateTrail(size_t index, const Node *node)
Node has changed position, update.
Class representing a general-purpose node an articulated scene graph.
const String & getMovableType(void) const
Overridden from MovableObject.
virtual size_t getChainIndexForNode(const Node *n)
Get the chain index for a given Node being tracked.
Factory object for creating RibbonTrail instances.
void nodeUpdated(const Node *node)
virtual void setWidthChange(size_t chainIndex, Real widthDeltaPerSecond)
Set the change in ribbon width per second.
Concrete IteratorWrapper for const access to the underlying container.
Real mTrailLength
Total length of trail in world units.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.