13 #include <osg/Drawable>
26 #include <matrix/vlVector.h>
28 #include <osg/Matrixd>
29 #include <osg/ref_ptr>
30 #include <osg/RenderInfo>
40 class DtGroundFogPatch;
42 class DtWeatherAreaGroup;
89 , myGroundFogUnfmLoc(0)
90 , myInstanceParamsUnfmLoc(0)
91 , myInstanceMatrixUnfmLoc(0)
92 , myPatternedUnfmLoc(0)
93 , mySkeletonUnfmLoc(0)
94 , mySoftnessUnfmLoc(0)
95 , myPatternSize(512.0f)
96 , myWindDirectionRad(0)
98 , myWeatherAreaGroup(0)
141 virtual void init(
float worldSize,
float thickness);
148 virtual void releaseFogPatchGLObjects(osg::State* state)
const;
151 virtual void releaseFogEffectGLObjects(osg::State* state)
const;
158 virtual bool cullUpdate(
const osg::Vec3d& camPos,
const osg::Matrixd& viewMatrixI,
162 virtual bool shouldDrawFogPatches();
172 virtual void setDensity(
float density);
175 virtual float density()
const;
181 virtual void setTransform(
const DtVector& position,
float orientation,
bool relativeToCamera =
false);
185 virtual void computeWorldTransform(osg::Vec3d& position, osg::Matrixf& rotation)
const;
189 virtual void setEnabled(
bool enabled);
192 virtual bool enabled()
const;
196 virtual void setClampingEnabled(
bool enabled);
199 virtual bool clampingEnabled()
const;
202 virtual float worldSize()
const;
205 virtual float computeParticleSize()
const;
210 virtual void setBounds(
const DtVector& bounds,
float cornerRadius);
214 virtual bool isPositionAboveArea(
const osg::Vec3d& position);
220 virtual void setBaseColor(
float red,
float green,
float blue);
224 virtual void setParticleSizeVariation(
float variation);
230 virtual void setPatternedLook(
bool patternedEnable);
245 virtual void computeBounds(osg::Vec4& bounds, osg::Vec3d& position, osg::Matrixd& rotation)
const;
253 : myVboPositionArray(0)
254 , myVboTexCoords0Array(0)
256 , myVboWeightsArray(0)
258 myPoints =
new osg::Vec3Array;
259 myTexCoords0 =
new osg::Vec2Array;
260 myBones =
new osg::Vec4Array;
261 myWeights =
new osg::Vec4Array;
290 virtual void freeData(
void);
298 virtual void computeWeights(
float x,
float y,
float patchSize,
float* bones,
float* weights);
303 virtual void initLod(
int gridSize,
float patchSize);
308 virtual bool bindMeshGroupData(
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
314 virtual bool bindVaoToMeshGroup(
GLuint vao,
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
319 virtual void computeBasis(
const osg::Vec3d& inGeocentricPos, osg::Matrixd& rotOut);
323 virtual void computeSortDepth(
const osg::Vec3& camPos);
329 virtual void inverseTransformPlane(osg::Vec4d& plane,
const osg::Vec3d& position,
const osg::Matrixd& rotation);
335 virtual bool isSphereVisible(
const std::vector<osg::Vec4d>& planes,
const osg::Vec3d& center,
double radius);
338 virtual void computeBoundsCulling();
341 virtual float computeEffectFade(
const osg::Vec3& localCam);
344 virtual double clampDistance()
const;
348 virtual bool clampPosition(osg::Vec3d& position);
351 virtual float computePatchCellSize()
const;
354 static int theSortWeights(
const void* arg0,
const void* arg1);
357 static int theSortBackToFront(
const void* arg0,
const void* arg1);
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
int myIndex
Definition: DtGroundFogPatchArea.h:285
const char * creatorTypeName< DtGroundFogPatchArea >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtGroundFogPatchArea.h:53
A structure used to hold data for drawing.
Definition: DtGroundFogEffect.h:53
DtGroundFogPatch ** myRenderPatches
Definition: DtGroundFogPatchArea.h:406
float myPatchWorldSize
Definition: DtGroundFogPatchArea.h:403
bool myEnabled
Definition: DtGroundFogPatchArea.h:364
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtDe & myDe
Definition: DtGroundFogPatchArea.h:361
osg::RenderInfo * myRenderInfo
Definition: DtGroundFogPatchArea.h:104
double myLastWindTime
Definition: DtGroundFogPatchArea.h:368
osg::ref_ptr< osg::Vec4Array > myBones
Definition: DtGroundFogPatchArea.h:266
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:18
float myBoundsX
Definition: DtGroundFogPatchArea.h:395
Contains makVrv::DtDe class.
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
float myBaseColorR
Definition: DtGroundFogPatchArea.h:377
double myWeight
Definition: DtGroundFogPatchArea.h:286
GLint myPatternedUnfmLoc
Definition: DtGroundFogPatchArea.h:109
Definition: DtGroundFogPatchArea.h:79
DrawData()
Definition: DtGroundFogPatchArea.h:86
BoneWeight()
Definition: DtGroundFogPatchArea.h:278
A group node which serves as a root for weather areas, patchy ground fog areas and effects...
Definition: DtWeatherAreaGroup.h:75
DtVirtualBaseClassCreator< DtGroundFogPatchArea, const float &, const float & > DtGroundFogPatchAreaCreator
creator
Definition: DtGroundFogPatchArea.h:46
GLint myGroundFogUnfmLoc
Definition: DtGroundFogPatchArea.h:106
MeshGroup()
Definition: DtGroundFogPatchArea.h:252
Camera forward declarations.
std::vector< DtGroundFogEffect * > myEffects
Definition: DtGroundFogPatchArea.h:409
int myClampBoneIndex
Definition: DtGroundFogPatchArea.h:374
osg::Vec3d myCamPos
Definition: DtGroundFogPatchArea.h:105
this class is used to create an effect around the eye to represent blowing particle effects such as s...
Definition: DtGroundFogEffect.h:48
std::vector< DtGroundFogPatch * > myPatches
Definition: DtGroundFogPatchArea.h:404
DtGlVaoManager * myVaoManager
Definition: DtGroundFogPatchArea.h:388
static const double DT_GFP_CLAMP_DISTANCE
Definition: DtGroundFogPatchArea.h:399
osg::Vec3d myBasisPos
Definition: DtGroundFogPatchArea.h:392
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
float myMaxClampOffset
Definition: DtGroundFogPatchArea.h:375
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
Contains makVrv::DtOsgCullVisitor class.
float myWindV
Definition: DtGroundFogPatchArea.h:367
GLint mySoftnessUnfmLoc
Definition: DtGroundFogPatchArea.h:111
bool myCameraBasisDirty
Definition: DtGroundFogPatchArea.h:370
int myRenderPatchCount
Definition: DtGroundFogPatchArea.h:407
float myPatternSize
Definition: DtGroundFogPatchArea.h:112
float myPatternedLook
Definition: DtGroundFogPatchArea.h:384
float myParticleSizeVariation
Definition: DtGroundFogPatchArea.h:381
float myWindU
Definition: DtGroundFogPatchArea.h:366
bool myInitialized
Definition: DtGroundFogPatchArea.h:371
float myWindDirectionRad
Definition: DtGroundFogPatchArea.h:113
A structure used to define a mesh group (voa, positions, coords).
Definition: DtGroundFogPatchArea.h:250
float myBaseColorB
Definition: DtGroundFogPatchArea.h:379
AreaType
brief Area type enumerations. Area types help with descibing the area for items like sensors...
Definition: DtGroundFogPatchArea.h:77
GLint myInstanceParamsUnfmLoc
Definition: DtGroundFogPatchArea.h:107
float myBaseColorG
Definition: DtGroundFogPatchArea.h:378
An area of ground fog patch items and effects. One ground fog patch area is associated with a non-inf...
Definition: DtGroundFogPatchArea.h:71
bool myClampingEnabled
Definition: DtGroundFogPatchArea.h:372
A generic OpenGL buffer. This can be: -> a vertex buffer -> an index buffer -> a shader storage buffe...
Definition: DtGlBuffer.h:29
float myWindSpeedMps
Definition: DtGroundFogPatchArea.h:114
float myOrientation
Definition: DtGroundFogPatchArea.h:391
osg::ref_ptr< osg::Vec4Array > myWeights
Definition: DtGroundFogPatchArea.h:267
int myGridSize
Definition: DtGroundFogPatchArea.h:402
GLint myInstanceMatrixUnfmLoc
Definition: DtGroundFogPatchArea.h:108
This class is used to manage an opengl vertex array object (VAO) dealing with multiple opengl context...
Definition: DtGlVaoManager.h:58
float myBoundsCornerRadius
Definition: DtGroundFogPatchArea.h:397
int myClampIndex
Definition: DtGroundFogPatchArea.h:373
Contains makVrv::DtGroundFogEffect class.
Contains DLL export macros.
float myDensity
Definition: DtGroundFogPatchArea.h:363
osg::ref_ptr< osg::Vec3Array > myPoints
Definition: DtGroundFogPatchArea.h:264
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:76
MeshGroup * myMeshGroup
Definition: DtGroundFogPatchArea.h:387
GLint mySkeletonUnfmLoc
Definition: DtGroundFogPatchArea.h:110
osg::StateSet * myState
Definition: DtGroundFogPatchArea.h:116
Contains the DtGlVaoManager class declaration.
int myPatchCount
Definition: DtGroundFogPatchArea.h:405
float myBoundsY
Definition: DtGroundFogPatchArea.h:396
const DtWeatherAreaGroup * myWeatherAreaGroup
Definition: DtGroundFogPatchArea.h:115
osg::Matrixd myBasisRot
Definition: DtGroundFogPatchArea.h:393
A structure used to hold data for drawing.
Definition: DtGroundFogPatchArea.h:84
osg::Vec3d myPosition
Definition: DtGroundFogPatchArea.h:390
AreaType myAreaType
Definition: DtGroundFogPatchArea.h:385
osg::ref_ptr< osg::Vec2Array > myTexCoords0
Definition: DtGroundFogPatchArea.h:265
static const int DT_GFP_CELL_SIZE
Definition: DtGroundFogPatchArea.h:400
A structure used to define a skeleton bone weight.
Definition: DtGroundFogPatchArea.h:276