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 , myWeatherAreaGroup(0)
137 virtual void init(
float worldSize,
float thickness);
144 virtual void releaseFogPatchGLObjects(osg::State* state)
const;
147 virtual void releaseFogEffectGLObjects(osg::State* state)
const;
155 virtual bool cullUpdate(
const osg::Vec3d& camPos,
const osg::Matrixd& viewMatrixI,
159 virtual bool shouldDrawFogPatches();
169 virtual void setDensity(
float density);
172 virtual float density()
const;
177 virtual void setWind(
const float windDirectionRad,
const float windSpeedMps);
183 virtual void setTransform(
const DtVector& position,
float orientation,
bool relativeToCamera =
false);
187 virtual void computeWorldTransform(osg::Vec3d& position, osg::Matrixf& rotation)
const;
191 virtual void setEnabled(
bool enabled);
194 virtual bool enabled()
const;
198 virtual void setClampingEnabled(
bool enabled);
201 virtual bool clampingEnabled()
const;
204 virtual float worldSize()
const;
207 virtual float computeParticleSize()
const;
212 virtual void setBounds(
const DtVector& bounds,
float cornerRadius);
216 virtual bool isPositionAboveArea(
const osg::Vec3d& position);
222 virtual void setBaseColor(
float red,
float green,
float blue);
226 virtual void setParticleSizeVariation(
float variation);
232 virtual void setPatternedLook(
bool patternedEnable);
247 virtual void computeBounds(osg::Vec4& bounds, osg::Vec3d& position, osg::Matrixd& rotation)
const;
255 : myVboPositionArray(0)
256 , myVboTexCoords0Array(0)
258 , myVboWeightsArray(0)
260 myPoints =
new osg::Vec3Array;
261 myTexCoords0 =
new osg::Vec2Array;
262 myBones =
new osg::Vec4Array;
263 myWeights =
new osg::Vec4Array;
292 virtual void freeData(
void);
300 virtual void computeWeights(
float x,
float y,
float patchSize,
float* bones,
float* weights);
305 virtual void initLod(
int gridSize,
float patchSize);
310 virtual bool bindMeshGroupData(
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
316 virtual bool bindVaoToMeshGroup(
GLuint vao,
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
320 virtual void computeSortDepth(
const osg::Vec3& camPos);
326 virtual void inverseTransformPlane(osg::Vec4d& plane,
const osg::Vec3d& position,
const osg::Matrixd& rotation);
332 virtual bool isSphereVisible(
const std::vector<osg::Vec4d>& planes,
const osg::Vec3d& center,
double radius);
335 virtual void computeBoundsCulling();
338 virtual float computeEffectFade(
const osg::Vec3& localCam);
341 virtual double clampDistance()
const;
345 virtual bool clampPosition(osg::Vec3d& position);
348 virtual float computePatchCellSize()
const;
351 static int theSortWeights(
const void* arg0,
const void* arg1);
354 static int theSortBackToFront(
const void* arg0,
const void* arg1);
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
int myIndex
Definition: DtGroundFogPatchArea.h:287
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:361
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtDe & myDe
Definition: DtGroundFogPatchArea.h:358
osg::RenderInfo * myRenderInfo
Definition: DtGroundFogPatchArea.h:102
double myLastWindTime
Definition: DtGroundFogPatchArea.h:368
osg::ref_ptr< osg::Vec4Array > myBones
Definition: DtGroundFogPatchArea.h:268
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:288
GLint myPatternedUnfmLoc
Definition: DtGroundFogPatchArea.h:107
Definition: DtGroundFogPatchArea.h:79
DrawData()
Definition: DtGroundFogPatchArea.h:86
BoneWeight()
Definition: DtGroundFogPatchArea.h:280
A group node which serves as a root for weather areas, patchy ground fog areas and effects...
Definition: DtWeatherAreaGroup.h:76
DtVirtualBaseClassCreator< DtGroundFogPatchArea, const float &, const float & > DtGroundFogPatchAreaCreator
creator
Definition: DtGroundFogPatchArea.h:46
GLint myGroundFogUnfmLoc
Definition: DtGroundFogPatchArea.h:104
MeshGroup()
Definition: DtGroundFogPatchArea.h:254
Camera forward declarations.
std::vector< DtGroundFogEffect * > myEffects
Definition: DtGroundFogPatchArea.h:409
int myClampBoneIndex
Definition: DtGroundFogPatchArea.h:374
osg::Vec3d myCamPos
Definition: DtGroundFogPatchArea.h:103
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
float myWindSpeedMps
Definition: DtGroundFogPatchArea.h:364
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:109
bool myCameraBasisDirty
Definition: DtGroundFogPatchArea.h:370
int myRenderPatchCount
Definition: DtGroundFogPatchArea.h:407
float myPatternSize
Definition: DtGroundFogPatchArea.h:110
float myPatternedLook
Definition: DtGroundFogPatchArea.h:384
float myParticleSizeVariation
Definition: DtGroundFogPatchArea.h:381
float myWindU
Definition: DtGroundFogPatchArea.h:366
bool myInitialized
Definition: DtGroundFogPatchArea.h:371
A structure used to define a mesh group (voa, positions, coords).
Definition: DtGroundFogPatchArea.h:252
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:105
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 myWindDirectionRad
Definition: DtGroundFogPatchArea.h:363
float myOrientation
Definition: DtGroundFogPatchArea.h:391
osg::ref_ptr< osg::Vec4Array > myWeights
Definition: DtGroundFogPatchArea.h:269
int myGridSize
Definition: DtGroundFogPatchArea.h:402
GLint myInstanceMatrixUnfmLoc
Definition: DtGroundFogPatchArea.h:106
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:360
osg::ref_ptr< osg::Vec3Array > myPoints
Definition: DtGroundFogPatchArea.h:266
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:108
osg::StateSet * myState
Definition: DtGroundFogPatchArea.h:112
Contains the DtGlVaoManager class declaration.
int myPatchCount
Definition: DtGroundFogPatchArea.h:405
float myBoundsY
Definition: DtGroundFogPatchArea.h:396
const DtWeatherAreaGroup * myWeatherAreaGroup
Definition: DtGroundFogPatchArea.h:111
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:267
static const int DT_GFP_CELL_SIZE
Definition: DtGroundFogPatchArea.h:400
A structure used to define a skeleton bone weight.
Definition: DtGroundFogPatchArea.h:278