Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
PUBillboardChain Class Reference

internal class, the tool class of PUBeamRender. More...

Inherited by PURibbonTrail.

Classes

class  Element
 Contains the data of an element of the BillboardChain. More...
 

Public Types

enum  TexCoordDirection { TCD_U, TCD_V }
 The direction in which texture coordinates from elements of the chain are used. More...
 

Public Member Functions

 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
 
virtual void setMaxChainElements (size_t maxElements)
 Set the maximum number of chain elements per chain. More...
 
virtual size_t getMaxChainElements (void) const
 Get the maximum number of chain elements per chain. More...
 
virtual void setNumberOfChains (size_t numChains)
 Set the number of chain segments (this class can render multiple chains at once using the same material). 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...
 
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...
 
var setOtherTextureCoordRange ( var start, var end)
 Set the range of the texture coordinates generated across the width of the chain elements. More...
 
local setOtherTextureCoordRange ( local start, local 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...
 
var addChainElement ( var chainIndex, var 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...
 
virtual const ElementgetChainElement (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 clearChain (size_t chainIndex)
 Remove all elements of a given chain (but leave the chain intact). More...
 
virtual void clearAllChains (void)
 Remove all elements from all chains (but leave the chains themselves intact).
 
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...
 
void setDepthTest (bool isDepthTest)
 Set whether use depth test. More...
 
void setDepthWrite (bool isDepthWrite)
 Set whether use depth write. More...
 
void setBlendFunc (const BlendFunc &blendFunc)
 Set whether use blend. More...
 
void render (Renderer *renderer, const Mat4 &transform, ParticleSystem3D *particleSystem)
 Rendering Chain. More...
 
GLuint getTextureName ()
 

Detailed Description

internal class, the tool class of PUBeamRender.

Constructor & Destructor Documentation

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.

The name to give this object. The maximum number of elements per chain. The number of separate chain segments contained in this object. If true, use texture coordinates from the chain elements. If true, use vertex colours from the chain elements. If true, buffers are created with the intention of being updated.

var PUBillboardChain ( var  name,
var  texFile = "",
var  maxElements = 20,
var  numberOfChains = 1,
var  useTextureCoords = true,
var  useColours = true,
var  dynamic = true 
)

Constructor.

The name to give this object. The maximum number of elements per chain. The number of separate chain segments contained in this object. If true, use texture coordinates from the chain elements. If true, use vertex colours from the chain elements. If true, buffers are created with the intention of being updated.

local PUBillboardChain ( local  name,
local  texFile = "",
local  maxElements = 20,
local  numberOfChains = 1,
local  useTextureCoords = true,
local  useColours = true,
local  dynamic = true 
)

Constructor.

The name to give this object. The maximum number of elements per chain. The number of separate chain segments contained in this object. If true, use texture coordinates from the chain elements. If true, use vertex colours from the chain elements. If true, buffers are created with the intention of being updated.

Member Function Documentation

virtual void setMaxChainElements ( size_t  maxElements)
virtual

Set the maximum number of chain elements per chain.

The maximum number of elements per chain.

var setMaxChainElements ( var  maxElements)
virtual

Set the maximum number of chain elements per chain.

The maximum number of elements per chain.

local setMaxChainElements ( local  maxElements)
virtual

Set the maximum number of chain elements per chain.

The maximum number of elements per chain.

virtual size_t getMaxChainElements ( void  ) const
inlinevirtual

Get the maximum number of chain elements per chain.

The maximum number of elements per chain.

var getMaxChainElements (   )
inlinevirtual

Get the maximum number of chain elements per chain.

The maximum number of elements per chain.

local getMaxChainElements (   )
inlinevirtual

Get the maximum number of chain elements per chain.

The maximum number of elements per chain.

virtual void setNumberOfChains ( size_t  numChains)
virtual

Set the number of chain segments (this class can render multiple chains at once using the same material).

The number of chain segments.

var setNumberOfChains ( var  numChains)
virtual

Set the number of chain segments (this class can render multiple chains at once using the same material).

The number of chain segments.

local setNumberOfChains ( local  numChains)
virtual

Set the number of chain segments (this class can render multiple chains at once using the same material).

The number of chain segments.

virtual size_t getNumberOfChains ( void  ) const
inlinevirtual

Get the number of chain segments (this class can render multiple chains at once using the same material).

The number of chain segments.

var getNumberOfChains (   )
inlinevirtual

Get the number of chain segments (this class can render multiple chains at once using the same material).

The number of chain segments.

local getNumberOfChains (   )
inlinevirtual

Get the number of chain segments (this class can render multiple chains at once using the same material).

The number of chain segments.

virtual void setUseTextureCoords ( bool  use)
virtual

Sets whether texture coordinate information should be included in the final buffers generated.

If use texture coordinate. You must use either texture coordinates or vertex colour since the vertices have no normals and without one of these there is no source of colour for the vertices.

var setUseTextureCoords ( var  use)
virtual

Sets whether texture coordinate information should be included in the final buffers generated.

If use texture coordinate. You must use either texture coordinates or vertex colour since the vertices have no normals and without one of these there is no source of colour for the vertices.

local setUseTextureCoords ( local  use)
virtual

Sets whether texture coordinate information should be included in the final buffers generated.

If use texture coordinate. You must use either texture coordinates or vertex colour since the vertices have no normals and without one of these there is no source of colour for the vertices.

virtual bool getUseTextureCoords ( void  ) const
inlinevirtual

Gets whether texture coordinate information should be included in the final buffers generated.

If use texture coordinate.

var getUseTextureCoords (   )
inlinevirtual

Gets whether texture coordinate information should be included in the final buffers generated.

If use texture coordinate.

local getUseTextureCoords (   )
inlinevirtual

Gets whether texture coordinate information should be included in the final buffers generated.

If use texture coordinate.

virtual void
setTextureCoordDirection
( TexCoordDirection  dir)
virtual

Sets the direction in which texture coords specified on each element are deemed to run along the length of the chain.

The direction, default is TCD_U.

var setTextureCoordDirection ( var  dir)
virtual

Sets the direction in which texture coords specified on each element are deemed to run along the length of the chain.

The direction, default is TCD_U.

local setTextureCoordDirection ( local  dir)
virtual

Sets the direction in which texture coords specified on each element are deemed to run along the length of the chain.

The direction, default is TCD_U.

virtual TexCoordDirection
getTextureCoordDirection
( void  )
inlinevirtual

Gets the direction in which texture coords specified on each element are deemed to run.

The direction.

var getTextureCoordDirection (   )
inlinevirtual

Gets the direction in which texture coords specified on each element are deemed to run.

The direction.

local getTextureCoordDirection (   )
inlinevirtual

Gets the direction in which texture coords specified on each element are deemed to run.

The direction.

virtual void
setOtherTextureCoordRange
( float  start,
float  end 
)
virtual

Set the range of the texture coordinates generated across the width of the chain elements.

Start coordinate, default 0.0. End coordinate, default 1.0.

var setOtherTextureCoordRange ( var  start,
var  end 
)
virtual

Set the range of the texture coordinates generated across the width of the chain elements.

Start coordinate, default 0.0. End coordinate, default 1.0.

local setOtherTextureCoordRange ( local  start,
local  end 
)
virtual

Set the range of the texture coordinates generated across the width of the chain elements.

Start coordinate, default 0.0. End coordinate, default 1.0.

virtual const float*
getOtherTextureCoordRange
( void  ) const
inlinevirtual

Get the range of the texture coordinates generated across the width of the chain elements.

Start and End coordinate.

var getOtherTextureCoordRange (   )
inlinevirtual

Get the range of the texture coordinates generated across the width of the chain elements.

Start and End coordinate.

local getOtherTextureCoordRange (   )
inlinevirtual

Get the range of the texture coordinates generated across the width of the chain elements.

Start and End coordinate.

virtual void setUseVertexColours ( bool  use)
virtual

Sets whether vertex colour information should be included in the final buffers generated.

If use vertex colour. You must use either texture coordinates or vertex colour since the vertices have no normals and without one of these there is no source of colour for the vertices.

var setUseVertexColours ( var  use)
virtual

Sets whether vertex colour information should be included in the final buffers generated.

If use vertex colour. You must use either texture coordinates or vertex colour since the vertices have no normals and without one of these there is no source of colour for the vertices.

local setUseVertexColours ( local  use)
virtual

Sets whether vertex colour information should be included in the final buffers generated.

If use vertex colour. You must use either texture coordinates or vertex colour since the vertices have no normals and without one of these there is no source of colour for the vertices.

virtual bool getUseVertexColours ( void  ) const
inlinevirtual

Gets whether vertex colour information should be included in the final buffers generated.

If use vertex colour.

var getUseVertexColours (   )
inlinevirtual

Gets whether vertex colour information should be included in the final buffers generated.

If use vertex colour.

local getUseVertexColours (   )
inlinevirtual

Gets whether vertex colour information should be included in the final buffers generated.

If use vertex colour.

virtual void setDynamic ( bool  dyn)
virtual

Sets whether or not the buffers created for this object are suitable for dynamic alteration.

If use dynamic buffers.

var setDynamic ( var  dyn)
virtual

Sets whether or not the buffers created for this object are suitable for dynamic alteration.

If use dynamic buffers.

local setDynamic ( local  dyn)
virtual

Sets whether or not the buffers created for this object are suitable for dynamic alteration.

If use dynamic buffers.

virtual bool getDynamic ( void  ) const
inlinevirtual

Gets whether or not the buffers created for this object are suitable for dynamic alteration.

If use dynamic buffers.

var getDynamic (   )
inlinevirtual

Gets whether or not the buffers created for this object are suitable for dynamic alteration.

If use dynamic buffers.

local getDynamic (   )
inlinevirtual

Gets whether or not the buffers created for this object are suitable for dynamic alteration.

If use dynamic buffers.

virtual void addChainElement ( size_t  chainIndex,
const Element billboardChainElement 
)
virtual

Add an element to the 'head' of a chain.

The index of the chain. The details to add. If this causes the number of elements to exceed the maximum elements per chain, the last element in the chain (the 'tail') will be removed to allow the additional element to be added.

var addChainElement ( var  chainIndex,
var  billboardChainElement 
)
virtual

Add an element to the 'head' of a chain.

The index of the chain. The details to add. If this causes the number of elements to exceed the maximum elements per chain, the last element in the chain (the 'tail') will be removed to allow the additional element to be added.

local addChainElement ( local  chainIndex,
local  billboardChainElement 
)
virtual

Add an element to the 'head' of a chain.

The index of the chain. The details to add. If this causes the number of elements to exceed the maximum elements per chain, the last element in the chain (the 'tail') will be removed to allow the additional element to be added.

virtual void removeChainElement ( size_t  chainIndex)
virtual

Remove an element from the 'tail' of a chain.

The index of the chain.

var removeChainElement ( var  chainIndex)
virtual

Remove an element from the 'tail' of a chain.

The index of the chain.

local removeChainElement ( local  chainIndex)
virtual

Remove an element from the 'tail' of a chain.

The index of the chain.

virtual void updateChainElement ( size_t  chainIndex,
size_t  elementIndex,
const Element billboardChainElement 
)
virtual

Update the details of an existing chain element.

The index of the chain. The element index within the chain, measured from the 'head' of the chain. The details to set.

var updateChainElement ( var  chainIndex,
var  elementIndex,
var  billboardChainElement 
)
virtual

Update the details of an existing chain element.

The index of the chain. The element index within the chain, measured from the 'head' of the chain. The details to set.

local updateChainElement ( local  chainIndex,
local  elementIndex,
local  billboardChainElement 
)
virtual

Update the details of an existing chain element.

The index of the chain. The element index within the chain, measured from the 'head' of the chain. The details to set.

virtual const Element&
getChainElement
( size_t  chainIndex,
size_t  elementIndex 
) const
virtual

Get the detail of a chain element.

The index of the chain. The element index within the chain, measured from the 'head' of the chain. The details to set.

var getChainElement ( var  chainIndex,
var  elementIndex 
)
virtual

Get the detail of a chain element.

The index of the chain. The element index within the chain, measured from the 'head' of the chain. The details to set.

local getChainElement ( local  chainIndex,
local  elementIndex 
)
virtual

Get the detail of a chain element.

The index of the chain. The element index within the chain, measured from the 'head' of the chain. The details to set.

virtual size_t getNumChainElements ( size_t  chainIndex) const
virtual

Returns the number of chain elements.

The index of the chain.

var getNumChainElements ( var  chainIndex)
virtual

Returns the number of chain elements.

The index of the chain.

local getNumChainElements ( local  chainIndex)
virtual

Returns the number of chain elements.

The index of the chain.

virtual void clearChain ( size_t  chainIndex)
virtual

Remove all elements of a given chain (but leave the chain intact).

The index of the chain.

var clearChain ( var  chainIndex)
virtual

Remove all elements of a given chain (but leave the chain intact).

The index of the chain.

local clearChain ( local  chainIndex)
virtual

Remove all elements of a given chain (but leave the chain intact).

The index of the chain.

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.

If facing the camera. Only used when faceCamera == false. Must be a non-zero vector. Billboards facing the camera are useful for smoke trails, light beams, etc by simulating a cylinder. However, because of this property, wide trails can cause several artefacts unless the head is properly covered. Therefore, non-camera-facing billboards are much more convenient for leaving big trails of movement from thin objects, for example a sword swing as seen in many fighting games.

var setFaceCamera ( var  faceCamera,
var  normalVector = Vec3::UNIT_X 
)

Sets whether the billboard should always be facing the camera or a custom direction set by each point element.

If facing the camera. Only used when faceCamera == false. Must be a non-zero vector. Billboards facing the camera are useful for smoke trails, light beams, etc by simulating a cylinder. However, because of this property, wide trails can cause several artefacts unless the head is properly covered. Therefore, non-camera-facing billboards are much more convenient for leaving big trails of movement from thin objects, for example a sword swing as seen in many fighting games.

local setFaceCamera ( local  faceCamera,
local  normalVector = Vec3::UNIT_X 
)

Sets whether the billboard should always be facing the camera or a custom direction set by each point element.

If facing the camera. Only used when faceCamera == false. Must be a non-zero vector. Billboards facing the camera are useful for smoke trails, light beams, etc by simulating a cylinder. However, because of this property, wide trails can cause several artefacts unless the head is properly covered. Therefore, non-camera-facing billboards are much more convenient for leaving big trails of movement from thin objects, for example a sword swing as seen in many fighting games.

void setDepthTest ( bool  isDepthTest)

Set whether use depth test.

Whether use depth test.

var setDepthTest ( var  isDepthTest)

Set whether use depth test.

Whether use depth test.

local setDepthTest ( local  isDepthTest)

Set whether use depth test.

Whether use depth test.

void setDepthWrite ( bool  isDepthWrite)

Set whether use depth write.

Whether use depth write.

var setDepthWrite ( var  isDepthWrite)

Set whether use depth write.

Whether use depth write.

local setDepthWrite ( local  isDepthWrite)

Set whether use depth write.

Whether use depth write.

void setBlendFunc ( const BlendFunc blendFunc)

Set whether use blend.

The blend function.

var setBlendFunc ( var  blendFunc)

Set whether use blend.

The blend function.

local setBlendFunc ( local  blendFunc)

Set whether use blend.

The blend function.

void render ( Renderer *  renderer,
const Mat4 transform,
ParticleSystem3D particleSystem 
)

Rendering Chain.

The Renderer. The transform to world. The current particle system.

var render ( var  renderer,
var  transform,
var  particleSystem 
)

Rendering Chain.

The Renderer. The transform to world. The current particle system.

local render ( local  renderer,
local  transform,
local  particleSystem 
)

Rendering Chain.

The Renderer. The transform to world. The current particle system.

GLuint getTextureName ( )

var getTextureName ( )

local getTextureName ( )


The documentation for this class was generated from the following file: