VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
makVrv::DtOsgDecalRibbon Class Reference

OpenSceneGraph implementation of a textured ribbon Used to draw effects like tread tracks that follow a scene object Procedurally generated as its position in the scene changes. More...

Inheritance diagram for makVrv::DtOsgDecalRibbon:
Inheritance graph
[legend]

Public Member Functions

 DtOsgDecalRibbon (DtDe &de, float segmentSpacing, const osg::Vec4 &color, osg::Texture *tex, float maxLength=2000)
 CTOR.
virtual void setTextureRepeat (float textureRepeat)
 Set the number of copies of the texture to repeat into each quad.
- Public Member Functions inherited from makVrv::DtOsgRibbon
 DtOsgRibbon (DtDe &de, float segmentSpacing=1.0, const osg::Vec4 &color=osg::Vec4d(0.5, 0.5, 0.5, 1.0), float maxLength=2000)
 CTOR.
virtual ~DtOsgRibbon ()
 DTOR.
virtual void traverse (osg::NodeVisitor &nv)
 Interrupt CullVisitors by updating the ribbon.
virtual osg::Node * node ()
 Get the osg geometry node associated with the ribbon.
virtual void setColor (const osg::Vec4 &color)
 Set the ribbon's color.
const osg::Vec4 & color () const
 Get the ribbon's color.
virtual void setDroppedPoints (const osg::Vec3d &pointA, const osg::Vec3d &pointB)
 Set the points to drop in local coordinates.
virtual void update (double dt, double simTime)
 Update the ribbon with the current position.
virtual void update ()
 Optional time independent update method.
virtual void setMaxSegments (long segments)
 Sets the maximum number of segments allowed in the ribbon.
long maxSegments () const
 Gets the maximum number of segments allowed in the ribbon.
virtual void setSegmentSpacing (float spacing)
 Sets the maximum length of ribbon segments.
float segmentSpacing () const
 Gets the maximum length of the ribbon segments.
virtual void setStippled (bool stippled)
bool isStippled () const
 Get the stipple setting for this ribbon.

Protected Member Functions

virtual ~DtOsgDecalRibbon ()
 DTOR.
virtual void addParticle (const osg::Vec3d &left, const osg::Vec3d &right, double simTime)
 Add a particle to the ribbon.
virtual float currentSegmentLength ()
 Find the length of the current ribbon segment.
virtual void extendCurrentSegment (osg::Vec3d const &left, osg::Vec3d const &right, double simTime)
 Extend the current segment to left and right points.
virtual osg::Drawable * getDrawable ()
 Create or get the ribbon drawable.
virtual int particleIndexAtOffset (int offset)
 Get index of particle at offset from current particle.
virtual void rotateDrawableIndices (int amount)
 Rotate the drawable primitives' indices by amount.
virtual osg::Vec2 getTextureCoordinateFor (int pointIndex, float vScale)
 Get the texture coordinate for a vertex.
virtual osg::Geode * createGeode ()
 Create the geode.
- Protected Member Functions inherited from makVrv::DtOsgRibbon
virtual void setDrawable ()
 Removes any existing drawables and add the drawable returned from getDrawable.

Private Attributes

osg::ref_ptr< osg::Vec3Array > myPoints
osg::ref_ptr< osg::Vec2Array > myTextureCoordinates
osg::ref_ptr
< osg::DrawElementsUInt > 
myRibbon
osg::ref_ptr< osg::Geometry > myGeometry
osg::ref_ptr< osg::Texture > myTexture
bool myWrappingVertices
std::string myTextureFilename
int myParticleIndex
float myTextureRepeat

Detailed Description

OpenSceneGraph implementation of a textured ribbon Used to draw effects like tread tracks that follow a scene object Procedurally generated as its position in the scene changes.

Constructor & Destructor Documentation

makVrv::DtOsgDecalRibbon::DtOsgDecalRibbon ( DtDe de,
float  segmentSpacing,
const osg::Vec4 &  color,
osg::Texture *  tex,
float  maxLength = 2000 
)

CTOR.

virtual makVrv::DtOsgDecalRibbon::~DtOsgDecalRibbon ( )
protectedvirtual

DTOR.

Member Function Documentation

virtual void makVrv::DtOsgDecalRibbon::setTextureRepeat ( float  textureRepeat)
virtual

Set the number of copies of the texture to repeat into each quad.

Textures are tiled in their v coordinate only.

virtual void makVrv::DtOsgDecalRibbon::addParticle ( const osg::Vec3d &  left,
const osg::Vec3d &  right,
double  simTime 
)
protectedvirtual

Add a particle to the ribbon.

Implements makVrv::DtOsgRibbon.

virtual float makVrv::DtOsgDecalRibbon::currentSegmentLength ( )
protectedvirtual

Find the length of the current ribbon segment.

Implements makVrv::DtOsgRibbon.

virtual void makVrv::DtOsgDecalRibbon::extendCurrentSegment ( osg::Vec3d const &  left,
osg::Vec3d const &  right,
double  simTime 
)
protectedvirtual

Extend the current segment to left and right points.

Implements makVrv::DtOsgRibbon.

virtual osg::Drawable* makVrv::DtOsgDecalRibbon::getDrawable ( )
protectedvirtual

Create or get the ribbon drawable.

Implements makVrv::DtOsgRibbon.

virtual int makVrv::DtOsgDecalRibbon::particleIndexAtOffset ( int  offset)
protectedvirtual

Get index of particle at offset from current particle.

virtual void makVrv::DtOsgDecalRibbon::rotateDrawableIndices ( int  amount)
protectedvirtual

Rotate the drawable primitives' indices by amount.

virtual osg::Vec2 makVrv::DtOsgDecalRibbon::getTextureCoordinateFor ( int  pointIndex,
float  vScale 
)
protectedvirtual

Get the texture coordinate for a vertex.

virtual osg::Geode* makVrv::DtOsgDecalRibbon::createGeode ( )
protectedvirtual

Create the geode.

Reimplemented from makVrv::DtOsgRibbon.

Member Data Documentation

osg::ref_ptr<osg::Vec3Array> makVrv::DtOsgDecalRibbon::myPoints
private
osg::ref_ptr<osg::Vec2Array> makVrv::DtOsgDecalRibbon::myTextureCoordinates
private
osg::ref_ptr<osg::DrawElementsUInt> makVrv::DtOsgDecalRibbon::myRibbon
private
osg::ref_ptr<osg::Geometry> makVrv::DtOsgDecalRibbon::myGeometry
private
osg::ref_ptr<osg::Texture> makVrv::DtOsgDecalRibbon::myTexture
private
bool makVrv::DtOsgDecalRibbon::myWrappingVertices
private
std::string makVrv::DtOsgDecalRibbon::myTextureFilename
private
int makVrv::DtOsgDecalRibbon::myParticleIndex
private
float makVrv::DtOsgDecalRibbon::myTextureRepeat
private

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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)