VR-Forces 4.1.1 Class Documentation
DtOsgParticleRibbon.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtOsgParticleRibbon.h,v $ $Revision: 1.15 $ $State: Exp $
7 ******************************************************************************/
8 
11 
12 #ifndef DtOsgParticleRibbon_H_
13 #define DtOsgParticleRibbon_H_
14 
15 #include <vrvOsg/vrvOsg.h>
16 #include <vrvOsg/DtOsgRibbon.h>
17 
18 #include <list>
19 
20 namespace osg
21 {
22  class DrawElementsUInt;
23  class Teture;
24 }
25 
26 namespace makVrv
27 {
33  {
34  public:
36  DtOsgParticleRibbon(float segmentSpacing,
37  const osg::Vec4& color, osg::Texture* texture,
38  float expansionRate, float maxLength = 2000);
39 
41  virtual void update(double dt, double simTime);
42 
45  virtual void setAlphaVelocity(float alphaVelocity);
46 
49  virtual void setTextureRepeat(float textureRepeat);
50 
51  protected:
53  virtual ~DtOsgParticleRibbon();
54 
56  virtual void addParticle(osg::Vec3d const& left, osg::Vec3d const& right,
57  double simTime);
58 
60  virtual float currentSegmentLength();
61 
63  virtual void extendCurrentSegment(osg::Vec3d const& left,
64  osg::Vec3d const& right, double simTime);
65 
67  virtual osg::Drawable* getDrawable();
68 
70  virtual int particleIndexAtOffset(int offset);
71 
73  virtual void updateParticles(double dt);
74 
76  virtual void updateGeometry(double dt);
77 
79  virtual osg::Vec2 getTextureCoordinateFor(int pointIndex, float vScale);
80 
82  virtual osg::Geode* createGeode();
83 
84 
85  private:
86  osg::ref_ptr<osg::Vec3Array> myPoints;
87  osg::ref_ptr<osg::Vec4Array> myColors;
88  osg::ref_ptr<osg::Vec2Array> myTextureCoordinates;
89  osg::ref_ptr<osg::Texture> myTexture;
90 
94  double myLastAddTime;
95 
97  struct Particle
98  {
99  osg::Vec3d center;
100  osg::Vec3d left;
101  osg::Vec3d right;
102  osg::Vec3d axis;
103  float angle;
104  float alpha;
105  };
106 
107  typedef std::list<Particle> Particles;
109 
113 
115  };
116 }
117 
118 #endif
119 

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)