VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgParticleRibbon.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 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 
54  virtual void setNewParticlesVisible(bool enable);
55 
56  protected:
58  virtual ~DtOsgParticleRibbon();
59 
61  virtual void addParticle(osg::Vec3d const& left, osg::Vec3d const& right,
62  double simTime);
63 
65  virtual float currentSegmentLength();
66 
68  virtual void extendCurrentSegment(osg::Vec3d const& left,
69  osg::Vec3d const& right, double simTime);
70 
72  virtual osg::Drawable* getDrawable();
73 
75  virtual int particleIndexAtOffset(int offset);
76 
78  virtual void updateParticles(double dt);
79 
81  virtual void updateGeometry(double dt);
82 
84  virtual osg::Vec2 getTextureCoordinateFor(int pointIndex, float vScale);
85 
87  virtual osg::Geode* createGeode();
88 
89  protected:
90  osg::ref_ptr<osg::Vec3Array> myPoints;
91  osg::ref_ptr<osg::Vec4Array> myColors;
92  osg::ref_ptr<osg::Vec2Array> myTextureCoordinates;
93  osg::ref_ptr<osg::Texture> myTexture;
94 
98  double myLastAddTime;
99 
101  struct Particle
102  {
103  osg::Vec3d center;
104  osg::Vec3d left;
105  osg::Vec3d right;
106  osg::Vec3d axis;
107  float angle;
108  float alpha;
109  };
110 
111  typedef std::list<Particle> Particles;
113 
117 
120  };
121 }
122 
123 #endif
124 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)