VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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/DtOsgRibbon.h>
16 
17 #include <list>
18 
19 namespace osg
20 {
21  class DrawElementsUInt;
22  class Teture;
23 }
24 
25 namespace makVrv
26 {
32  {
33  public:
35  DtOsgParticleRibbon(DtDe& de, float segmentSpacing,
36  const osg::Vec4& color, osg::Texture* texture,
37  float expansionRate, float maxLength = 2000);
38 
40  virtual void update(double dt, double simTime);
41 
44  virtual void setAlphaVelocity(float alphaVelocity);
45 
48  virtual void setTextureRepeat(float textureRepeat);
49 
50  protected:
52  virtual ~DtOsgParticleRibbon();
53 
55  virtual void addParticle(osg::Vec3d const& left, osg::Vec3d const& right,
56  double simTime);
57 
59  virtual float currentSegmentLength();
60 
62  virtual void extendCurrentSegment(osg::Vec3d const& left,
63  osg::Vec3d const& right, double simTime);
64 
66  virtual osg::Drawable* getDrawable();
67 
69  virtual int particleIndexAtOffset(int offset);
70 
72  virtual void updateParticles(double dt);
73 
75  virtual void updateGeometry(double dt);
76 
78  virtual osg::Vec2 getTextureCoordinateFor(int pointIndex, float vScale);
79 
81  virtual osg::Geode* createGeode();
82 
83 
84  private:
85  osg::ref_ptr<osg::Vec3Array> myPoints;
86  osg::ref_ptr<osg::Vec4Array> myColors;
87  osg::ref_ptr<osg::Vec2Array> myTextureCoordinates;
88  osg::ref_ptr<osg::Texture> myTexture;
89 
93  double myLastAddTime;
94 
96  struct Particle
97  {
98  osg::Vec3d center;
99  osg::Vec3d left;
100  osg::Vec3d right;
101  osg::Vec3d axis;
102  float angle;
103  float alpha;
104  };
105 
106  typedef std::list<Particle> Particles;
108 
112 
114  };
115 }
116 
117 #endif
118 

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)