VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGroundFogPatch.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <vrvUtil/DtJobSplitter.h>
16 
17 #include <osg/RenderInfo>
18 #include <osg/Vec3d>
19 
20 
21 namespace makVrv
22 {
23 
33  {
34  public:
35 
38 
40  virtual ~DtGroundFogPatch();
41 
42  private:
43 
45  DtGroundFogPatch(const DtGroundFogPatch &other);
46 
48  DtGroundFogPatch &operator=(const DtGroundFogPatch &other);
49 
50  public:
51 
55  virtual void init(int gridSize, float patchSize);
56 
58  virtual void draw(osg::RenderInfo& renderInfo) const;
59 
62  virtual void updateAlphaFade(double time);
63 
67  virtual void cullUpdate(const osg::Vec3d& camPos, DtJobSplitter* jobSplitter);
68 
71  virtual void setTransform(const osg::Vec3d& position);
72 
74  virtual const osg::Vec3d& position() const;
75 
77  virtual const float* skeleton() const;
78 
83  virtual void getBonePosition(int boneIndex, float patchSize, osg::Vec3d& position);
84 
88  virtual void setBoneHeight(int boneIndex, float height);
89 
92  virtual void setDesiredAlphaFade(float value);
93 
96  virtual void setAlphaFade(float value);
97 
99  virtual float alphaFade() const;
100 
103  virtual void SetCulled(bool culled);
104 
106  virtual bool culled() const;
107 
111  virtual void setBoneHeightExtents(float min, float max);
112 
116  virtual void getBoneHeightExtents(float& min, float& max);
117 
119  virtual void computeBoneHeightExtents();
120 
123  virtual void runSort(const osg::Vec3& localCamPos);
124 
125  protected:
126 
129  virtual void computeSortDepth(const osg::Vec3& camPos);
130 
132  virtual void fillSortedIndices();
133 
134  private:
135 
137  void freeData(void);
138 
140  static int theSortBackToFront(const void* arg0, const void* arg1);
141 
143  static void theSortJob(void* data);
144 
145  public:
146 
147  int mySortDepth; // keep public for optimized sorting
148 
149  protected:
150 
152  struct Cell
153  {
155  : mySortDepth(0)
156  , myVertexStart(0)
157  , myCenter(0,0,0)
158  {
159  //intentional nop
160  }
161 
163  unsigned short myVertexStart;
164  osg::Vec3 myCenter;
165  };
166 
168  struct SortJobData
169  {
171  : myPatch(0)
172  , myCameraPos(0,0,0)
173  {
174  //intentional nop
175  }
176 
178  osg::Vec3 myCameraPos;
179  };
180 
181  unsigned short myIndiceCount;
182  unsigned short* myIndices;
183 
186 
187  osg::Vec3d myPosition;
188  double myLastTime;
189  float myAlphaFade;
191  bool myCulled;
194 
195  float mySkeleton[9]; // a 3x3 skeletal grid used to bend the mesh
196 
199  };
200 
201 
204  {
205  public:
208 
210  virtual ~DtGroundFogPatchCreator();
211 
212  private:
216  DtGroundFogPatchCreator &operator=(const DtGroundFogPatchCreator& other);
217 
218  public:
222  virtual DtGroundFogPatch* create(int gridSize, float patchSize) const;
223 
226  static DtGroundFogPatchCreator& instance(DtDe& de);
227 
229  static const std::string& theClassName();
230 
231  protected:
233  };
234 }
235 
236 
237 
238 
bool myCulled
Definition: DtGroundFogPatch.h:191
Virtual base class.
Definition: DtVirtualBaseClass.h:22
unsigned short myVertexStart
Definition: DtGroundFogPatch.h:163
float myBoneHeightMax
Definition: DtGroundFogPatch.h:193
DtGroundFogPatch * myPatch
Definition: DtGroundFogPatch.h:177
double myLastTime
Definition: DtGroundFogPatch.h:188
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
unsigned short * myIndices
Definition: DtGroundFogPatch.h:182
DtDe & myDe
Definition: DtGroundFogPatch.h:232
osg::Vec3d myPosition
Definition: DtGroundFogPatch.h:187
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
an object used to represent 1 patch of a patchy ground fog system.
Definition: DtGroundFogPatch.h:32
int myCellCount
Definition: DtGroundFogPatch.h:185
Contains makVrv::DtVirtualBaseClass class.
Contains makVrv::DtJobSplitter class.
SortJobData mySortJobData
Definition: DtGroundFogPatch.h:197
DtJobSplitterJob mySortJob
Definition: DtGroundFogPatch.h:198
unsigned short myIndiceCount
Definition: DtGroundFogPatch.h:181
int mySortDepth
Definition: DtGroundFogPatch.h:162
float myAlphaFade
Definition: DtGroundFogPatch.h:189
creator for DtGroundFogPatch
Definition: DtGroundFogPatch.h:203
a cell in the voxel grid
Definition: DtGroundFogPatch.h:152
SortJobData()
Definition: DtGroundFogPatch.h:170
Cell()
Definition: DtGroundFogPatch.h:154
int mySortDepth
Definition: DtGroundFogPatch.h:147
A generic structure to hold data for a job for use with DtJobSplitter.
Definition: DtJobSplitter.h:26
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
Cell * myCells
Definition: DtGroundFogPatch.h:184
Contains DLL export macros.
osg::Vec3 myCenter
Definition: DtGroundFogPatch.h:164
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
osg::Vec3 myCameraPos
Definition: DtGroundFogPatch.h:178
a structure to hold data for a sorting job
Definition: DtGroundFogPatch.h:168
float myAlphaFadeDesired
Definition: DtGroundFogPatch.h:190
float myBoneHeightMin
Definition: DtGroundFogPatch.h:192

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)