#include <CCPURibbonTrail.h>
Public Types | |
| typedef std::vector< Node * > | NodeList |
Public Types inherited from PUBillboardChain | |
| enum | TexCoordDirection { TCD_U, TCD_V } |
| The direction in which texture coordinates from elements of the chain are used. More... | |
| typedef std::vector< Element > | ElementList |
Public Member Functions | |
| PURibbonTrail (const std::string &name, const std::string &texFile="", size_t maxElements=20, size_t numberOfChains=1, bool useTextureCoords=true, bool useColours=true) | |
| Constructor. More... | |
| virtual | ~PURibbonTrail () |
| destructor More... | |
| virtual void | addNode (Node *n) |
| Add a node to be tracked. More... | |
| var | addNode ( var n) |
| Add a node to be tracked. More... | |
| local | addNode ( local n) |
| Add a node to be tracked. More... | |
| virtual void | removeNode (Node *n) |
| Remove tracking on a given node. More... | |
| local | removeNode ( local n) |
| Remove tracking on a given node. More... | |
| virtual size_t | getChainIndexForNode (const Node *n) |
| Get the chain index for a given Node being tracked. More... | |
| var | getChainIndexForNode ( var n) |
| Get the chain index for a given Node being tracked. More... | |
| local | getChainIndexForNode ( local n) |
| Get the chain index for a given Node being tracked. More... | |
| void | setAttachedNode (Node *parent) |
| virtual void | setTrailLength (float len) |
| Set the length of the trail. More... | |
| local | setTrailLength ( local len) |
| Set the length of the trail. More... | |
| virtual float | getTrailLength (void) const |
| Get the length of the trail. More... | |
| local | getTrailLength () |
| Get the length of the trail. More... | |
| void | setMaxChainElements (size_t maxElements) |
| void | setNumberOfChains (size_t numChains) |
| void | clearChain (size_t chainIndex) |
| virtual void | setInitialColour (size_t chainIndex, const Vec4 &col) |
| Set the starting ribbon colour for a given segment. More... | |
| local | setInitialColour ( local chainIndex, local col) |
| Set the starting ribbon colour for a given segment. More... | |
| virtual void | setInitialColour (size_t chainIndex, float r, float g, float b, float a=1.0) |
| Set the starting ribbon colour. More... | |
| virtual const Vec4 & | getInitialColour (size_t chainIndex) const |
| Get the starting ribbon colour. More... | |
| virtual void | setColourChange (size_t chainIndex, const Vec4 &valuePerSecond) |
| Enables / disables fading the trail using colour. More... | |
| virtual void | setInitialWidth (size_t chainIndex, float width) |
| Set the starting ribbon width in world units. More... | |
| virtual float | getInitialWidth (size_t chainIndex) const |
| Get the starting ribbon width in world units. More... | |
| virtual void | setWidthChange (size_t chainIndex, float widthDeltaPerSecond) |
| Set the change in ribbon width per second. More... | |
| var | setWidthChange ( var chainIndex, var widthDeltaPerSecond) |
| Set the change in ribbon width per second. More... | |
| local | setWidthChange ( local chainIndex, local widthDeltaPerSecond) |
| Set the change in ribbon width per second. More... | |
| virtual float | getWidthChange (size_t chainIndex) const |
| Get the change in ribbon width per second. More... | |
| virtual void | setColourChange (size_t chainIndex, float r, float g, float b, float a) |
| Enables / disables fading the trail using colour. More... | |
| local | setColourChange ( local chainIndex, local r, local g, local b, local a) |
| Enables / disables fading the trail using colour. More... | |
| virtual const Vec4 & | getColourChange (size_t chainIndex) const |
| Get the per-second fading amount. More... | |
| void | update (float deltaTime) |
| void | nodeUpdated (const Node *node) |
| void | nodeDestroyed (const Node *node) |
| void | timeUpdate (float time) |
| Perform any fading / width delta required; internal method. More... | |
Public Member Functions inherited from PUBillboardChain | |
| PUBillboardChain (const std::string &name, const std::string &texFile="", size_t maxElements=20, size_t numberOfChains=1, bool useTextureCoords=true, bool useColours=true, bool dynamic=true) | |
| Constructor. More... | |
| PUBillboardChain ( var name, var 20, var 1, var true, var true, var true) | |
| Constructor. More... | |
| PUBillboardChain ( local name, local 20, local 1, local true, local true, local true) | |
| Constructor. More... | |
| virtual | ~PUBillboardChain () |
| destructor More... | |
| virtual size_t | getMaxChainElements (void) const |
| Get the maximum number of chain elements per chain. More... | |
| virtual size_t | getNumberOfChains (void) const |
| Get the number of chain segments (this class can render multiple chains at once using the same material). More... | |
| virtual void | setUseTextureCoords (bool use) |
| Sets whether texture coordinate information should be included in the final buffers generated. More... | |
| virtual bool | getUseTextureCoords (void) const |
| Gets whether texture coordinate information should be included in the final buffers generated. More... | |
| var | getUseTextureCoords () |
| Gets whether texture coordinate information should be included in the final buffers generated. More... | |
| local | getUseTextureCoords () |
| Gets whether texture coordinate information should be included in the final buffers generated. More... | |
| virtual void | setTextureCoordDirection (TexCoordDirection dir) |
| Sets the direction in which texture coords specified on each element are deemed to run along the length of the chain. More... | |
| virtual TexCoordDirection | getTextureCoordDirection (void) |
| Gets the direction in which texture coords specified on each element are deemed to run. More... | |
| local | getTextureCoordDirection () |
| Gets the direction in which texture coords specified on each element are deemed to run. More... | |
| virtual void | setOtherTextureCoordRange (float start, float end) |
| Set the range of the texture coordinates generated across the width of the chain elements. More... | |
| virtual const float * | getOtherTextureCoordRange (void) const |
| Get the range of the texture coordinates generated across the width of the chain elements. More... | |
| virtual void | setUseVertexColours (bool use) |
| Sets whether vertex colour information should be included in the final buffers generated. More... | |
| virtual bool | getUseVertexColours (void) const |
| Gets whether vertex colour information should be included in the final buffers generated. More... | |
| virtual void | setDynamic (bool dyn) |
| Sets whether or not the buffers created for this object are suitable for dynamic alteration. More... | |
| virtual bool | getDynamic (void) const |
| Gets whether or not the buffers created for this object are suitable for dynamic alteration. More... | |
| virtual void | addChainElement (size_t chainIndex, const Element &billboardChainElement) |
| Add an element to the 'head' of a chain. More... | |
| local | addChainElement ( local chainIndex, local billboardChainElement) |
| Add an element to the 'head' of a chain. More... | |
| virtual void | removeChainElement (size_t chainIndex) |
| Remove an element from the 'tail' of a chain. More... | |
| virtual void | updateChainElement (size_t chainIndex, size_t elementIndex, const Element &billboardChainElement) |
| Update the details of an existing chain element. More... | |
| var | updateChainElement ( var chainIndex, var elementIndex, var billboardChainElement) |
| Update the details of an existing chain element. More... | |
| local | updateChainElement ( local chainIndex, local elementIndex, local billboardChainElement) |
| Update the details of an existing chain element. More... | |
| virtual const Element & | getChainElement (size_t chainIndex, size_t elementIndex) const |
| Get the detail of a chain element. More... | |
| local | getChainElement ( local chainIndex, local elementIndex) |
| Get the detail of a chain element. More... | |
| virtual size_t | getNumChainElements (size_t chainIndex) const |
| Returns the number of chain elements. More... | |
| virtual void | clearAllChains (void) |
| Remove all elements from all chains (but leave the chains themselves intact). More... | |
| void | setFaceCamera (bool faceCamera, const Vec3 &normalVector=Vec3::UNIT_X) |
| Sets whether the billboard should always be facing the camera or a custom direction set by each point element. More... | |
| virtual void | setDepthTest (bool isDepthTest) |
| virtual void | setDepthWrite (bool isDepthWrite) |
| void | render (Renderer *renderer, const Mat4 &transform, ParticleSystem3D *particleSystem) |
Protected Types | |
| typedef std::vector< size_t > | IndexVector |
| Mapping of nodes to chain segments. More... | |
| typedef std::map< const Node *, size_t > | NodeToChainSegmentMap |
| typedef std::vector< Vec4 > | ColorValueList |
| typedef std::vector< float > | RealList |
Protected Types inherited from PUBillboardChain | |
| typedef std::vector< ChainSegment > | ChainSegmentList |
Protected Member Functions | |
| void | manageController (void) |
| Manage updates to the time controller. More... | |
| void | updateTrail (size_t index, const Node *node) |
| Node has changed position, update. More... | |
| void | resetTrail (size_t index, const Node *node) |
| Reset the tracked chain to initial state. More... | |
| void | resetAllTrails (void) |
| Reset all tracked chains to initial state. More... | |
Protected Member Functions inherited from PUBillboardChain | |
| virtual void | setupChainContainers (void) |
| virtual void | setupVertexDeclaration (void) |
| Setup vertex declaration. More... | |
| virtual void | setupBuffers (void) |
| virtual void | updateVertexBuffer (const Mat4 &camMat) |
| Update the contents of the vertex buffer. More... | |
| local | updateVertexBuffer ( local camMat) |
| Update the contents of the vertex buffer. More... | |
| virtual void | updateIndexBuffer (void) |
| Update the contents of the index buffer. More... | |
| void | init (const std::string &texFile) |
Protected Attributes | |
| NodeList | _nodeList |
| List of nodes being trailed. More... | |
| IndexVector | _nodeToChainSegment |
| Ordered like mNodeList, contains chain index. More... | |
| var | _nodeToChainSegment |
| Ordered like mNodeList, contains chain index. More... | |
| local | _nodeToChainSegment |
| Ordered like mNodeList, contains chain index. More... | |
| IndexVector | _freeChains |
| NodeToChainSegmentMap | _nodeToSegMap |
| var | _nodeToSegMap |
| local | _nodeToSegMap |
| float | _trailLength |
| Total length of trail in world units. More... | |
| float | _elemLength |
| length of each element More... | |
| float | _squaredElemLength |
| Squared length of each element. More... | |
| var | _squaredElemLength |
| Squared length of each element. More... | |
| local | _squaredElemLength |
| Squared length of each element. More... | |
| ColorValueList | _initialColor |
| Initial colour of the ribbon. More... | |
| ColorValueList | _deltaColor |
| fade amount per second More... | |
| RealList | _initialWidth |
| Initial width of the ribbon. More... | |
| RealList | _deltaWidth |
| Delta width of the ribbon. More... | |
| Node * | _parentNode |
| bool | _needTimeUpdate |
Protected Attributes inherited from PUBillboardChain | |
| size_t | _maxElementsPerChain |
| Maximum length of each chain. More... | |
| size_t | _chainCount |
| Number of chains. More... | |
| bool | _useTexCoords |
| Use texture coords? More... | |
| bool | _useVertexColour |
| Use vertex colour? More... | |
| var | _useVertexColour |
| Use vertex colour? More... | |
| local | _useVertexColour |
| Use vertex colour? More... | |
| bool | _dynamic |
| Dynamic use? More... | |
| bool | _vertexDeclDirty |
| Is the vertex declaration dirty? More... | |
| bool | _buffersNeedRecreating |
| Do the buffers need recreating? More... | |
| bool | _boundsDirty |
| Do the bounds need redefining? More... | |
| bool | _indexContentDirty |
| Is the index buffer dirty? More... | |
| var | _indexContentDirty |
| Is the index buffer dirty? More... | |
| local | _indexContentDirty |
| Is the index buffer dirty? More... | |
| bool | _vertexContentDirty |
| Is the vertex buffer dirty? More... | |
| TexCoordDirection | _texCoordDir |
| Texture coord direction. More... | |
| float | _otherTexCoordRange [2] |
| Other texture coord range. More... | |
| bool | _faceCamera |
| When true, the billboards always face the camera. More... | |
| Vec3 | _normalBase |
| Used when mFaceCamera == false; determines the billboard's "normal". More... | |
| ElementList | _chainElementList |
| The list holding the chain elements. More... | |
| ChainSegmentList | _chainSegmentList |
| MeshCommand * | _meshCommand |
| Texture2D * | _texture |
| GLProgramState * | _glProgramState |
| IndexBuffer * | _indexBuffer |
| VertexBuffer * | _vertexBuffer |
| std::vector< VertexInfo > | _vertices |
| var | _vertices |
| local | _vertices |
| std::vector< unsigned short > | _indices |
Additional Inherited Members | |
Static Protected Attributes inherited from PUBillboardChain | |
| static const size_t | SEGMENT_EMPTY |
| Chain segment has no elements. More... | |
|
protected |
|
protected |
|
protected |
|
protected |
Mapping of nodes to chain segments.
|
protected |
Mapping of nodes to chain segments.
|
protected |
Mapping of nodes to chain segments.
| var NodeList |
| local NodeList |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| PURibbonTrail | ( | const std::string & | name, |
| const std::string & | texFile = "", |
||
| size_t | maxElements = 20, |
||
| size_t | numberOfChains = 1, |
||
| bool | useTextureCoords = true, |
||
| bool | useColours = true |
||
| ) |
Constructor.
| name | The name to give this object |
| maxElements | The maximum number of elements per chain |
| numberOfChains | The number of separate chain segments contained in this object, ie the maximum number of nodes that can have trails attached |
| useTextureCoords | If true, use texture coordinates from the chain elements |
| useVertexColors | If true, use vertex colors from the chain elements (must be true if you intend to use fading) |
| var PURibbonTrail | ( | var | name, |
| var | texFile = "", |
||
| var | maxElements = 20, |
||
| var | numberOfChains = 1, |
||
| var | useTextureCoords = true, |
||
| var | useColours = true |
||
| ) |
Constructor.
| name | The name to give this object |
| maxElements | The maximum number of elements per chain |
| numberOfChains | The number of separate chain segments contained in this object, ie the maximum number of nodes that can have trails attached |
| useTextureCoords | If true, use texture coordinates from the chain elements |
| useVertexColors | If true, use vertex colors from the chain elements (must be true if you intend to use fading) |
| local PURibbonTrail | ( | local | name, |
| local | texFile = "", |
||
| local | maxElements = 20, |
||
| local | numberOfChains = 1, |
||
| local | useTextureCoords = true, |
||
| local | useColours = true |
||
| ) |
Constructor.
| name | The name to give this object |
| maxElements | The maximum number of elements per chain |
| numberOfChains | The number of separate chain segments contained in this object, ie the maximum number of nodes that can have trails attached |
| useTextureCoords | If true, use texture coordinates from the chain elements |
| useVertexColors | If true, use vertex colors from the chain elements (must be true if you intend to use fading) |
|
virtual |
destructor
|
virtual |
destructor
|
virtual |
destructor
|
virtual |
Add a node to be tracked.
| n | The node that will be tracked. |
|
virtual |
Add a node to be tracked.
| n | The node that will be tracked. |
|
virtual |
Add a node to be tracked.
| n | The node that will be tracked. |
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Get the chain index for a given Node being tracked.
|
virtual |
Get the chain index for a given Node being tracked.
|
virtual |
Get the chain index for a given Node being tracked.
|
virtual |
Get the per-second fading amount.
|
virtual |
Get the per-second fading amount.
|
virtual |
Get the per-second fading amount.
|
virtual |
Get the starting ribbon colour.
|
virtual |
Get the starting ribbon colour.
|
virtual |
Get the starting ribbon colour.
|
virtual |
Get the starting ribbon width in world units.
|
virtual |
Get the starting ribbon width in world units.
|
virtual |
Get the starting ribbon width in world units.
|
inlinevirtual |
Get the length of the trail.
|
inlinevirtual |
Get the length of the trail.
|
inlinevirtual |
Get the length of the trail.
|
virtual |
Get the change in ribbon width per second.
|
virtual |
Get the change in ribbon width per second.
|
virtual |
Get the change in ribbon width per second.
|
protected |
Manage updates to the time controller.
|
protected |
Manage updates to the time controller.
|
protected |
Manage updates to the time controller.
| void nodeDestroyed | ( | const Node * | node | ) |
| var nodeDestroyed | ( | var | node | ) |
| local nodeDestroyed | ( | local | node | ) |
| void nodeUpdated | ( | const Node * | node | ) |
| var nodeUpdated | ( | var | node | ) |
| local nodeUpdated | ( | local | node | ) |
|
virtual |
Remove tracking on a given node.
|
virtual |
Remove tracking on a given node.
|
virtual |
Remove tracking on a given node.
|
protected |
Reset all tracked chains to initial state.
|
protected |
Reset all tracked chains to initial state.
|
protected |
Reset all tracked chains to initial state.
|
protected |
Reset the tracked chain to initial state.
|
protected |
Reset the tracked chain to initial state.
|
protected |
Reset the tracked chain to initial state.
|
inline |
|
inline |
|
inline |
|
virtual |
Enables / disables fading the trail using colour.
| chainIndex | The index of the chain |
| valuePerSecond | The amount to subtract from colour each second |
|
virtual |
Enables / disables fading the trail using colour.
| chainIndex | The index of the chain |
| valuePerSecond | The amount to subtract from colour each second |
|
virtual |
Enables / disables fading the trail using colour.
| chainIndex | The index of the chain |
| valuePerSecond | The amount to subtract from colour each second |
|
virtual |
Enables / disables fading the trail using colour.
| chainIndex | The index of the chain |
| r,g,b,a | The amount to subtract from each colour channel per second |
|
virtual |
Enables / disables fading the trail using colour.
| chainIndex | The index of the chain |
| r,g,b,a | The amount to subtract from each colour channel per second |
|
virtual |
Enables / disables fading the trail using colour.
| chainIndex | The index of the chain |
| r,g,b,a | The amount to subtract from each colour channel per second |
|
virtual |
Set the starting ribbon colour for a given segment.
| chainIndex | The index of the chain |
| col | The initial colour |
|
virtual |
Set the starting ribbon colour for a given segment.
| chainIndex | The index of the chain |
| col | The initial colour |
|
virtual |
Set the starting ribbon colour for a given segment.
| chainIndex | The index of the chain |
| col | The initial colour |
|
virtual |
Set the starting ribbon colour.
| chainIndex | The index of the chain |
| r,b,g,a | The initial colour |
|
virtual |
Set the starting ribbon colour.
| chainIndex | The index of the chain |
| r,b,g,a | The initial colour |
|
virtual |
Set the starting ribbon colour.
| chainIndex | The index of the chain |
| r,b,g,a | The initial colour |
|
virtual |
Set the starting ribbon width in world units.
| chainIndex | The index of the chain |
| width | The initial width of the ribbon |
|
virtual |
Set the starting ribbon width in world units.
| chainIndex | The index of the chain |
| width | The initial width of the ribbon |
|
virtual |
Set the starting ribbon width in world units.
| chainIndex | The index of the chain |
| width | The initial width of the ribbon |
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Reimplemented from PUBillboardChain.
|
virtual |
Set the length of the trail.
| len | The length of the trail in world units |
|
virtual |
Set the length of the trail.
| len | The length of the trail in world units |
|
virtual |
Set the length of the trail.
| len | The length of the trail in world units |
|
virtual |
Set the change in ribbon width per second.
| chainIndex | The index of the chain |
| widthDeltaPerSecond | The amount the width will reduce by per second |
|
virtual |
Set the change in ribbon width per second.
| chainIndex | The index of the chain |
| widthDeltaPerSecond | The amount the width will reduce by per second |
|
virtual |
Set the change in ribbon width per second.
| chainIndex | The index of the chain |
| widthDeltaPerSecond | The amount the width will reduce by per second |
| void timeUpdate | ( | float | time | ) |
Perform any fading / width delta required; internal method.
| var timeUpdate | ( | var | time | ) |
Perform any fading / width delta required; internal method.
| local timeUpdate | ( | local | time | ) |
Perform any fading / width delta required; internal method.
| void update | ( | float | deltaTime | ) |
| var update | ( | var | deltaTime | ) |
| local update | ( | local | deltaTime | ) |
|
protected |
Node has changed position, update.
|
protected |
Node has changed position, update.
|
protected |
fade amount per second
|
protected |
fade amount per second
|
protected |
fade amount per second
|
protected |
Delta width of the ribbon.
|
protected |
Delta width of the ribbon.
|
protected |
Delta width of the ribbon.
|
protected |
length of each element
|
protected |
length of each element
|
protected |
length of each element
|
protected |
|
protected |
|
protected |
|
protected |
Initial colour of the ribbon.
|
protected |
Initial colour of the ribbon.
|
protected |
Initial colour of the ribbon.
|
protected |
Initial width of the ribbon.
|
protected |
Initial width of the ribbon.
|
protected |
Initial width of the ribbon.
|
protected |
|
protected |
|
protected |
|
protected |
List of nodes being trailed.
|
protected |
Ordered like mNodeList, contains chain index.
|
protected |
Ordered like mNodeList, contains chain index.
|
protected |
Ordered like mNodeList, contains chain index.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Squared length of each element.
|
protected |
Squared length of each element.
|
protected |
Squared length of each element.
|
protected |
Total length of trail in world units.
|
protected |
Total length of trail in world units.
|
protected |
Total length of trail in world units.