VR-Forces 4.8 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) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vrvOsg/DtOsgRibbon.h>
12 
14 
15 #include <list>
16 
17 namespace osg
18 {
19  class DrawElementsUInt;
20  class Teture;
21 }
22 
23 namespace makVrv
24 {
30  {
31  protected:
33  DtOsgParticleRibbon(DtDe& de, float segmentSpacing,
34  const osg::Vec4& color, osg::Texture* texture,
35  float expansionRate, float maxLength);
36 
38 
40  virtual ~DtOsgParticleRibbon();
41 
42  private:
48  DtOsgParticleRibbon &operator=(const DtOsgParticleRibbon&);
49 
50  public:
51 
53  virtual void update(double dt, double simTime);
54 
57  virtual void setAlphaVelocity(float alphaVelocity);
58 
61  virtual void setTextureRepeat(float textureRepeat);
62 
67  virtual void setNewParticlesVisible(bool enable);
68 
69  protected:
71  virtual void addParticle(osg::Vec3d const& left, osg::Vec3d const& right,
72  double simTime);
73 
75  virtual float currentSegmentLength();
76 
78  virtual void extendCurrentSegment(osg::Vec3d const& left,
79  osg::Vec3d const& right, double simTime);
80 
82  virtual osg::Drawable* getDrawable();
83 
85  virtual int particleIndexAtOffset(int offset);
86 
88  virtual void updateParticles(double dt);
89 
91  virtual void updateGeometry(double dt);
92 
94  virtual osg::Vec2 getTextureCoordinateFor(int pointIndex, float vScale);
95 
97  virtual osg::Geode* createGeode();
98 
102  virtual void cleanupOldSegments(double simTime);
103 
104  protected:
109 
114 
116  struct Particle
117  {
118  osg::Vec3d center;
119  osg::Vec3d left;
120  osg::Vec3d right;
121  osg::Vec3d axis;
122  float angle;
123  float alpha;
124  };
125 
126  typedef std::list<Particle> Particles;
128 
132 
134  };
135 
136  //
137  // Creator for DtOsgParticleRibbons
138  //
140  {
141  public:
142 
145 
146 
148  virtual ~DtOsgParticleRibbonCreator();
149 
152  static DtOsgParticleRibbonCreator& instance(DtDe& de);
153 
156  static void registerInstance(DtDe& de, DtOsgParticleRibbonCreator* creator);
157 
159  virtual DtOsgParticleRibbon* create(DtDe& de, float segmentSpacing,
160  const osg::Vec4& color, osg::Texture* texture,
161  float expansionRate, float maxLength = 2000);
162  };
163 }
164 
float angle
left-to-right axis of the particle&#39;s quad
Definition: DtOsgParticleRibbon.h:122
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
bool myNewParticleVisible
Definition: DtOsgParticleRibbon.h:133
Virtual base class.
Definition: DtVirtualBaseClass.h:22
std::list< Particle > Particles
Definition: DtOsgParticleRibbon.h:126
Definition: DtOsgParticleRibbon.h:139
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::Vec3Array > myPoints
Definition: DtOsgParticleRibbon.h:105
Particles myParticles
Definition: DtOsgParticleRibbon.h:127
osg::Vec3d axis
Definition: DtOsgParticleRibbon.h:121
float myRotationalVelocity
speed at which particles move apart
Definition: DtOsgParticleRibbon.h:131
double myLastAddTime
Definition: DtOsgParticleRibbon.h:113
float myTextureRepeat
Definition: DtOsgParticleRibbon.h:112
osg::Vec3d center
Definition: DtOsgParticleRibbon.h:118
Contains makVrv::DtVirtualBaseClass class.
osg::ref_ptr< osg::Vec4Array > myColors
Definition: DtOsgParticleRibbon.h:106
Definition for a particle in the ribbon.
Definition: DtOsgParticleRibbon.h:116
osg::Vec3d right
Definition: DtOsgParticleRibbon.h:120
int myParticleIndex
Definition: DtOsgParticleRibbon.h:111
float alpha
How much rotation is applied to the particle.
Definition: DtOsgParticleRibbon.h:123
Base class for OSG ribbon implementations.
Definition: DtOsgRibbon.h:25
A ribbon with some particle system features, such as expansion rate texture, and fading out...
Definition: DtOsgParticleRibbon.h:29
float myAlphaVelocity
Definition: DtOsgParticleRibbon.h:129
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
osg::ref_ptr< osg::Vec2Array > myTextureCoordinates
Definition: DtOsgParticleRibbon.h:107
Base class for ribbons.
voidpf uLong offset
Definition: ioapi.h:42
osg::ref_ptr< osg::Texture > myTexture
Definition: DtOsgParticleRibbon.h:108
bool myWrappingVertices
Definition: DtOsgParticleRibbon.h:110
osg::Vec3d left
center back of the particle&#39;s quad
Definition: DtOsgParticleRibbon.h:119
float myExpansionRate
speed at which alpha decreases
Definition: DtOsgParticleRibbon.h:130

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)