13 #include <osg/Drawable>
22 #include <matrix/vlVector.h>
24 #include <osg/Matrixd>
25 #include <osg/ref_ptr>
26 #include <osg/RenderInfo>
36 class DtGroundFogPatch;
38 class DtWeatherAreaGroup;
74 , myGroundFogUnfmLoc(0)
75 , myInstanceParamsUnfmLoc(0)
76 , myInstanceMatrixUnfmLoc(0)
77 , myPatternedUnfmLoc(0)
78 , mySkeletonUnfmLoc(0)
79 , mySoftnessUnfmLoc(0)
80 , myPatternSize(512.0f)
81 , myWindDirectionRad(0)
83 , myWeatherAreaGroup(0)
126 virtual void init(
float worldSize,
float thickness);
133 virtual void releaseFogPatchGLObjects(osg::State* state)
const;
136 virtual void releaseFogEffectGLObjects(osg::State* state)
const;
142 virtual bool cullUpdate(
const osg::Vec3d& camPos,
const osg::Matrixd& viewMatrixI,
const std::vector<osg::Vec4d>& cullingPlanes,
DtJobSplitter* jobSplitter);
145 virtual bool shouldDrawFogPatches();
155 virtual void setDensity(
float density);
158 virtual float density()
const;
164 virtual void setTransform(
const DtVector& position,
float orientation,
bool relativeToCamera =
false);
168 virtual void computeWorldTransform(osg::Vec3d& position, osg::Matrixf& rotation)
const;
172 virtual void setEnabled(
bool enabled);
175 virtual bool enabled()
const;
179 virtual void setClampingEnabled(
bool enabled);
182 virtual bool clampingEnabled()
const;
185 virtual float worldSize()
const;
188 virtual float computeParticleSize()
const;
193 virtual void setBounds(
const DtVector& bounds,
float cornerRadius);
197 virtual bool isPositionAboveArea(
const osg::Vec3d& position);
203 virtual void setBaseColor(
float red,
float green,
float blue);
207 virtual void setParticleSizeVariation(
float variation);
213 virtual void setPatternedLook(
bool patternedEnable);
228 virtual void computeBounds(osg::Vec4& bounds, osg::Vec3d& position, osg::Matrixd& rotation)
const;
236 : myVboPositionArray(0)
237 , myVboTexCoords0Array(0)
239 , myVboWeightsArray(0)
241 myPoints =
new osg::Vec3Array;
242 myTexCoords0 =
new osg::Vec2Array;
243 myBones =
new osg::Vec4Array;
244 myWeights =
new osg::Vec4Array;
273 virtual void freeData(
void);
281 virtual void computeWeights(
float x,
float y,
float patchSize,
float* bones,
float* weights);
286 virtual void initLod(
int gridSize,
float patchSize);
291 virtual bool bindMeshGroupData(
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
297 virtual bool bindVaoToMeshGroup(
GLuint vao,
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
302 virtual void computeBasis(
const osg::Vec3d& inGeocentricPos, osg::Matrixd& rotOut);
306 virtual void computeSortDepth(
const osg::Vec3& camPos);
312 virtual void inverseTransformPlane(osg::Vec4d& plane,
const osg::Vec3d& position,
const osg::Matrixd& rotation);
318 virtual bool isSphereVisible(
const std::vector<osg::Vec4d>& planes,
const osg::Vec3d& center,
double radius);
321 virtual void computeBoundsCulling();
324 virtual float computeEffectFade(
const osg::Vec3& localCam);
327 virtual double clampDistance()
const;
331 virtual bool clampPosition(osg::Vec3d& position);
334 virtual float computePatchCellSize()
const;
337 static int theSortWeights(
const void* arg0,
const void* arg1);
340 static int theSortBackToFront(
const void* arg0,
const void* arg1);
423 static const std::string& theClassName();
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
int myIndex
Definition: DtGroundFogPatchArea.h:268
Virtual base class.
Definition: DtVirtualBaseClass.h:19
A structure used to hold data for drawing.
Definition: DtGroundFogEffect.h:41
DtGroundFogPatch ** myRenderPatches
Definition: DtGroundFogPatchArea.h:389
float myPatchWorldSize
Definition: DtGroundFogPatchArea.h:386
bool myEnabled
Definition: DtGroundFogPatchArea.h:347
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtDe & myDe
Definition: DtGroundFogPatchArea.h:344
osg::RenderInfo * myRenderInfo
Definition: DtGroundFogPatchArea.h:89
double myLastWindTime
Definition: DtGroundFogPatchArea.h:351
osg::ref_ptr< osg::Vec4Array > myBones
Definition: DtGroundFogPatchArea.h:249
creator for DtGroundFogPatchArea
Definition: DtGroundFogPatchArea.h:397
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
float myBoundsX
Definition: DtGroundFogPatchArea.h:378
Contains makVrv::DtDe class.
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
float myBaseColorR
Definition: DtGroundFogPatchArea.h:360
double myWeight
Definition: DtGroundFogPatchArea.h:269
GLint myPatternedUnfmLoc
Definition: DtGroundFogPatchArea.h:94
Definition: DtGroundFogPatchArea.h:64
DrawData()
Definition: DtGroundFogPatchArea.h:71
BoneWeight()
Definition: DtGroundFogPatchArea.h:261
A group node which serves as a root for weather areas, patchy ground fog areas and effects...
Definition: DtWeatherAreaGroup.h:72
GLint myGroundFogUnfmLoc
Definition: DtGroundFogPatchArea.h:91
MeshGroup()
Definition: DtGroundFogPatchArea.h:235
DtDe & myDe
Definition: DtGroundFogPatchArea.h:426
std::vector< DtGroundFogEffect * > myEffects
Definition: DtGroundFogPatchArea.h:392
int myClampBoneIndex
Definition: DtGroundFogPatchArea.h:357
osg::Vec3d myCamPos
Definition: DtGroundFogPatchArea.h:90
this class is used to create an effect around the eye to represent blowing particle effects such as s...
Definition: DtGroundFogEffect.h:36
std::vector< DtGroundFogPatch * > myPatches
Definition: DtGroundFogPatchArea.h:387
DtGlVaoManager * myVaoManager
Definition: DtGroundFogPatchArea.h:371
static const double DT_GFP_CLAMP_DISTANCE
Definition: DtGroundFogPatchArea.h:382
osg::Vec3d myBasisPos
Definition: DtGroundFogPatchArea.h:375
float myMaxClampOffset
Definition: DtGroundFogPatchArea.h:358
an object used to represent 1 patch of a patchy ground fog system.
Definition: DtGroundFogPatch.h:33
unsigned int myVboTexCoords0Array
Definition: DtGroundFogPatchArea.h:253
Contains makVrv::DtOsgCullVisitor class.
float myWindV
Definition: DtGroundFogPatchArea.h:350
unsigned int myVboWeightsArray
Definition: DtGroundFogPatchArea.h:255
GLint mySoftnessUnfmLoc
Definition: DtGroundFogPatchArea.h:96
bool myCameraBasisDirty
Definition: DtGroundFogPatchArea.h:353
int myRenderPatchCount
Definition: DtGroundFogPatchArea.h:390
float myPatternSize
Definition: DtGroundFogPatchArea.h:97
unsigned int myVboBonesArray
Definition: DtGroundFogPatchArea.h:254
float myPatternedLook
Definition: DtGroundFogPatchArea.h:367
float myParticleSizeVariation
Definition: DtGroundFogPatchArea.h:364
float myWindU
Definition: DtGroundFogPatchArea.h:349
bool myInitialized
Definition: DtGroundFogPatchArea.h:354
float myWindDirectionRad
Definition: DtGroundFogPatchArea.h:98
A structure used to define a mesh group (voa, positions, coords).
Definition: DtGroundFogPatchArea.h:233
float myBaseColorB
Definition: DtGroundFogPatchArea.h:362
AreaType
brief Area type enumerations.
Definition: DtGroundFogPatchArea.h:62
GLint myInstanceParamsUnfmLoc
Definition: DtGroundFogPatchArea.h:92
float myBaseColorG
Definition: DtGroundFogPatchArea.h:361
An area of ground fog patch items and effects.
Definition: DtGroundFogPatchArea.h:56
bool myClampingEnabled
Definition: DtGroundFogPatchArea.h:355
float myWindSpeedMps
Definition: DtGroundFogPatchArea.h:99
float myOrientation
Definition: DtGroundFogPatchArea.h:374
osg::ref_ptr< osg::Vec4Array > myWeights
Definition: DtGroundFogPatchArea.h:250
int myGridSize
Definition: DtGroundFogPatchArea.h:385
GLint myInstanceMatrixUnfmLoc
Definition: DtGroundFogPatchArea.h:93
This class is used to manage an opengl vertex array object (VAO) dealing with multiple opengl context...
Definition: DtGlVaoManager.h:49
float myBoundsCornerRadius
Definition: DtGroundFogPatchArea.h:380
int myClampIndex
Definition: DtGroundFogPatchArea.h:356
Contains makVrv::DtGroundFogEffect class.
Contains DLL export macros.
float myDensity
Definition: DtGroundFogPatchArea.h:346
osg::ref_ptr< osg::Vec3Array > myPoints
Definition: DtGroundFogPatchArea.h:247
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
MeshGroup * myMeshGroup
Definition: DtGroundFogPatchArea.h:370
GLint mySkeletonUnfmLoc
Definition: DtGroundFogPatchArea.h:95
unsigned int myVboPositionArray
Definition: DtGroundFogPatchArea.h:252
osg::StateSet * myState
Definition: DtGroundFogPatchArea.h:101
Contains the DtGlVaoManager class declaration.
int myPatchCount
Definition: DtGroundFogPatchArea.h:388
float myBoundsY
Definition: DtGroundFogPatchArea.h:379
const DtWeatherAreaGroup * myWeatherAreaGroup
Definition: DtGroundFogPatchArea.h:100
osg::Matrixd myBasisRot
Definition: DtGroundFogPatchArea.h:376
A structure used to hold data for drawing.
Definition: DtGroundFogPatchArea.h:69
osg::Vec3d myPosition
Definition: DtGroundFogPatchArea.h:373
AreaType myAreaType
Definition: DtGroundFogPatchArea.h:368
osg::ref_ptr< osg::Vec2Array > myTexCoords0
Definition: DtGroundFogPatchArea.h:248
static const int DT_GFP_CELL_SIZE
Definition: DtGroundFogPatchArea.h:383
A structure used to define a skeleton bone weight.
Definition: DtGroundFogPatchArea.h:259