VR-Forces 5.0.1 Developer's Guide
 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 <vrvCore/DtJobSplitter.h>
15 
17 
18 #include <osg/RenderInfo>
19 #include <osg/Vec3d>
20 
21 
22 namespace makVrv
23 {
24 
34  {
35  public:
36 
39 
41  virtual ~DtGroundFogPatch();
42 
43  private:
44 
46  DtGroundFogPatch(const DtGroundFogPatch &other);
47 
49  DtGroundFogPatch &operator=(const DtGroundFogPatch &other);
50 
51  public:
52 
56  virtual void init(int gridSize, float patchSize);
57 
59  virtual void draw(osg::RenderInfo& renderInfo) const;
60 
63  virtual void updateAlphaFade(double time);
64 
68  virtual void cullUpdate(const osg::Vec3d& camPos, DtJobSplitter* jobSplitter);
69 
72  virtual void setTransform(const osg::Vec3d& position);
73 
75  virtual const osg::Vec3d& position() const;
76 
78  virtual const float* skeleton() const;
79 
84  virtual void getBonePosition(int boneIndex, float patchSize, osg::Vec3d& position);
85 
89  virtual void setBoneHeight(int boneIndex, float height);
90 
93  virtual void setDesiredAlphaFade(float value);
94 
97  virtual void setAlphaFade(float value);
98 
100  virtual float alphaFade() const;
101 
104  virtual void SetCulled(bool culled);
105 
107  virtual bool culled() const;
108 
112  virtual void setBoneHeightExtents(float min, float max);
113 
117  virtual void getBoneHeightExtents(float& min, float& max);
118 
120  virtual void computeBoneHeightExtents();
121 
124  virtual void runSort(const osg::Vec3& localCamPos);
125 
126  protected:
127 
130  virtual void computeSortDepth(const osg::Vec3& camPos);
131 
133  virtual void fillSortedIndices();
134 
135  private:
136 
138  void freeData(void);
139 
141  static int theSortBackToFront(const void* arg0, const void* arg1);
142 
144  static void theSortJob(void* data);
145 
146  public:
147 
148  int mySortDepth; // keep public for optimized sorting
149 
150  protected:
151 
153  struct Cell
154  {
156  : mySortDepth(0)
157  , myVertexStart(0)
158  , myCenter(0,0,0)
159  {
160  //intentional nop
161  }
162 
164  unsigned short myVertexStart;
165  osg::Vec3 myCenter;
166  };
167 
169  struct SortJobData
170  {
172  : myPatch(0)
173  , myCameraPos(0,0,0)
174  {
175  //intentional nop
176  }
177 
179  osg::Vec3 myCameraPos;
180  };
181 
182  unsigned short myIndiceCount;
183  unsigned short* myIndices;
184 
187 
188  osg::Vec3d myPosition;
189  double myLastTime;
190  float myAlphaFade;
192  bool myCulled;
195 
196  float mySkeleton[9]; // a 3x3 skeletal grid used to bend the mesh
197 
200  };
201 
202 
205  {
206  public:
209 
211  virtual ~DtGroundFogPatchCreator();
212 
213  private:
217  DtGroundFogPatchCreator &operator=(const DtGroundFogPatchCreator& other);
218 
219  public:
223  virtual DtGroundFogPatch* create(int gridSize, float patchSize) const;
224 
227  static DtGroundFogPatchCreator& instance(DtDe& de);
228 
230  static const std::string& theClassName();
231 
232  protected:
234  };
235 }
236 
237 
238 
239 
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
bool myCulled
Definition: DtGroundFogPatch.h:192
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
unsigned short myVertexStart
Definition: DtGroundFogPatch.h:164
float myBoneHeightMax
Definition: DtGroundFogPatch.h:194
DtGroundFogPatch * myPatch
Definition: DtGroundFogPatch.h:178
double myLastTime
Definition: DtGroundFogPatch.h:189
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
unsigned short * myIndices
Definition: DtGroundFogPatch.h:183
DtDe & myDe
Definition: DtGroundFogPatch.h:233
osg::Vec3d myPosition
Definition: DtGroundFogPatch.h:188
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. The patch is made up of cells in a...
Definition: DtGroundFogPatch.h:33
int myCellCount
Definition: DtGroundFogPatch.h:186
Contains makVrv::DtVirtualBaseClass class.
Contains makVrv::DtJobSplitter class.
SortJobData mySortJobData
Definition: DtGroundFogPatch.h:198
DtJobSplitterJob mySortJob
Definition: DtGroundFogPatch.h:199
unsigned short myIndiceCount
Definition: DtGroundFogPatch.h:182
int mySortDepth
Definition: DtGroundFogPatch.h:163
float myAlphaFade
Definition: DtGroundFogPatch.h:190
creator for DtGroundFogPatch
Definition: DtGroundFogPatch.h:204
a cell in the voxel grid
Definition: DtGroundFogPatch.h:153
SortJobData()
Definition: DtGroundFogPatch.h:171
Cell()
Definition: DtGroundFogPatch.h:155
int mySortDepth
Definition: DtGroundFogPatch.h:148
A generic structure to hold data for a job for use with DtJobSplitter.
Definition: DtJobSplitter.h:26
Cell * myCells
Definition: DtGroundFogPatch.h:185
Contains DLL export macros.
osg::Vec3 myCenter
Definition: DtGroundFogPatch.h:165
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
osg::Vec3 myCameraPos
Definition: DtGroundFogPatch.h:179
a structure to hold data for a sorting job
Definition: DtGroundFogPatch.h:169
float myAlphaFadeDesired
Definition: DtGroundFogPatch.h:191
float myBoneHeightMin
Definition: DtGroundFogPatch.h:193

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)