21 #include <matrix/vlVector.h>
30 class DtWeatherAreaGroup;
31 class DtWeatherLightningFactory;
51 , myParametersUnfmLoc(0)
52 , myTransformUnfmLoc(0)
53 , myWeatherAreaGroup(0)
91 virtual void releaseGLObjects(osg::State* state)
const;
97 virtual void simulationUpdate(
float timeStep,
double currentTime,
DtJobSplitter* jobSplitter);
103 virtual bool cullUpdate(
const osg::Vec3d& camPos,
const osg::Matrixd& viewMatrixI,
104 const std::vector<osg::Vec4d>& cullingPlanes,
DtJobSplitter* jobSplitter);
112 virtual void setBounds(
const DtVector& bounds,
float cornerRadius);
117 virtual void setTransform(
const osg::Vec3d& position,
const osg::Matrixd& rotation);
121 virtual void setIntensity(
const float intensity);
125 virtual void setBaseColor(
const DtVector& color);
129 virtual void runSort(
const osg::Vec3& localCamPos);
133 virtual void setEnabled(
bool enabled);
136 virtual bool enabled()
const;
140 virtual bool culled()
const;
146 virtual void computeBounds(osg::Vec4& bounds, osg::Vec3d& position, osg::Matrixd& rotation)
const;
154 : myVboPositionArray(0)
155 , myVboNormalArray(0)
156 , myVboTexCoordArray(0)
157 , myVboIndiceArray(0)
160 , myActivePointCount(0)
162 myPoints =
new osg::Vec4Array;
163 myNormals =
new osg::Vec4Array;
164 myTexCoords =
new osg::Vec2Array;
184 : myDirection(1, 0, 0)
194 osg::Vec3 myPoints[16];
208 , myLightPosition(0,0,0)
250 virtual void createBolt(
const osg::Vec3& start,
const osg::Vec3& end);
262 virtual bool positionInBounds2D(
const float x,
const float y,
const osg::Vec3& bounds);
267 virtual float computeRandomMinMax(
float fMin,
float fMax);
271 virtual void computeSortDepth(
const osg::Vec3& reference);
287 virtual bool bindMeshGroupData(
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
292 virtual bool bindDynamicMeshGroupData(
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
298 virtual bool bindVaoToMeshGroup(
GLuint vao,
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
304 virtual bool isSphereVisible(
const std::vector<osg::Vec4d>& planes,
const osg::Vec3d& center,
double radius)
const;
309 const osg::Vec3 crossProduct(
const osg::Vec3& v0,
const osg::Vec3& v1)
const;
314 static void theSortJob(
void* data);
322 : myWeatherLightning(0)
323 , myLocalCameraPos(0, 0, 0)
393 static const std::string& theClassName();
const DtWeatherAreaGroup * myWeatherAreaGroup
Definition: DtWeatherLightning.h:64
float myIntensity
Definition: DtWeatherLightning.h:346
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
int myActiveFingers
Definition: DtWeatherLightning.h:226
A structure to hold data for a sorting job.
Definition: DtWeatherLightning.h:319
std::vector< LightningFinger * > myChildren
Definition: DtWeatherLightning.h:195
osg::Vec3 myBaseColor
Definition: DtWeatherLightning.h:347
float myBoundsCornerRadius
Definition: DtWeatherLightning.h:343
GLint myParametersUnfmLoc
Definition: DtWeatherLightning.h:62
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
Implementation independent random number generator.
Definition: DtRandomNumberGenerator.h:20
osg::Vec3 myDirection
Definition: DtWeatherLightning.h:191
unsigned int myVboNormalArray
Definition: DtWeatherLightning.h:175
osg::Vec3d myCamPos
Definition: DtWeatherLightning.h:60
float myBoltWidth
Definition: DtWeatherLightning.h:345
osg::Vec3d myLightPosition
Definition: DtWeatherLightning.h:224
float myWidthScale
Definition: DtWeatherLightning.h:192
osg::Vec3 myEnd
Definition: DtWeatherLightning.h:223
bool myMeshDirty
Definition: DtWeatherLightning.h:230
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::Vec2Array > myTexCoords
Definition: DtWeatherLightning.h:169
std::vector< LightningBolt * > myMutableLightningBoltsActive
Definition: DtWeatherLightning.h:351
unsigned int myVboIndiceArray
Definition: DtWeatherLightning.h:177
MeshGroup()
Definition: DtWeatherLightning.h:153
LightningBolt()
Definition: DtWeatherLightning.h:201
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
A structure used to hold data for drawing.
Definition: DtWeatherLightning.h:46
Contains makVrv::DtDe class.
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
DtWeatherLightning * myWeatherLightning
Definition: DtWeatherLightning.h:328
A structure used to define a lightning bolt.
Definition: DtWeatherLightning.h:199
A group node which serves as a root for weather areas, patchy ground fog areas and effects...
Definition: DtWeatherAreaGroup.h:72
DtDe & myDe
Definition: DtWeatherLightning.h:332
unsigned int myIndicesCount
Definition: DtWeatherLightning.h:171
osg::Matrixd myViewMatrix
Definition: DtWeatherLightning.h:61
float myStrikeTimer
Definition: DtWeatherLightning.h:361
unsigned int myVboTexCoordArray
Definition: DtWeatherLightning.h:176
This class simulates and renders a lightning area. The area will randomly create lightning within a s...
Definition: DtWeatherLightning.h:39
float myBoundsZ
Definition: DtWeatherLightning.h:342
A structure used to define a lightning bolt finger.
Definition: DtWeatherLightning.h:181
osg::RenderInfo * myRenderInfo
Definition: DtWeatherLightning.h:59
float myBoundsX
Definition: DtWeatherLightning.h:340
DtDe & myDe
Definition: DtWeatherLightning.h:400
Contains makVrv::DtVirtualBaseClass class.
Contains makVrv::DtRandomNumberGenerator class.
osg::ref_ptr< osg::Vec4Array > myPoints
Definition: DtWeatherLightning.h:167
unsigned int myActivePointCount
Definition: DtWeatherLightning.h:172
Contains makVrv::DtJobSplitter class.
osg::ref_ptr< osg::Vec4Array > myNormals
Definition: DtWeatherLightning.h:168
DtGlVaoManager * myVaoManager
Definition: DtWeatherLightning.h:229
osg::StateSet * myState
Definition: DtWeatherLightning.h:65
float myTime
Definition: DtWeatherLightning.h:221
osg::Vec3 myStart
Definition: DtWeatherLightning.h:222
DrawData()
Definition: DtWeatherLightning.h:48
DtLight * myLight
Definition: DtWeatherLightning.h:363
osg::Matrixd myRotation
Definition: DtWeatherLightning.h:338
A structure used to define a mesh group (voa, positions, coords).
Definition: DtWeatherLightning.h:151
DtJobSplitterJob mySortJob
Definition: DtWeatherLightning.h:354
Definition: DtWeatherLightning.h:237
DtRandomNumberGenerator myRandomNumberGen
Definition: DtWeatherLightning.h:356
A generic structure to hold data for a job for use with DtJobSplitter.
Definition: DtJobSplitter.h:26
SortJobData()
Definition: DtWeatherLightning.h:321
LightningFinger()
Definition: DtWeatherLightning.h:183
SortJobData mySortJobData
Definition: DtWeatherLightning.h:353
std::vector< LightningBolt * > myMutableLightningBoltsPool
Definition: DtWeatherLightning.h:350
bool myEnabled
Definition: DtWeatherLightning.h:334
Class for generic lights This holds per-light data such as range, attenuation factors, colors, etc.
Definition: DtLight.h:48
Factory that is used to create weather lightning areas.
Definition: DtWeatherLightning.h:370
This class is used to manage an opengl vertex array object (VAO) dealing with multiple opengl context...
Definition: DtGlVaoManager.h:65
float myStrikeTimeMax
Definition: DtWeatherLightning.h:360
float myBoundsY
Definition: DtWeatherLightning.h:341
osg::Vec3d myPosition
Definition: DtWeatherLightning.h:337
float myUnique
Definition: DtWeatherLightning.h:219
int myChildDepth
Definition: DtWeatherLightning.h:193
Contains DLL export macros.
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
float myStrikeTimeMin
Definition: DtWeatherLightning.h:359
Contains the DtGlVaoManager class declaration.
unsigned short * myIndices
Definition: DtWeatherLightning.h:170
unsigned int myVboPositionArray
Definition: DtWeatherLightning.h:174
GLint myTransformUnfmLoc
Definition: DtWeatherLightning.h:63
float mySortDepth
Definition: DtWeatherLightning.h:218
bool myCulled
Definition: DtWeatherLightning.h:335
float myAliveTime
Definition: DtWeatherLightning.h:220
MeshGroup * myMeshGroup
Definition: DtWeatherLightning.h:228
LightningFinger * myRootFinger
Definition: DtWeatherLightning.h:227
osg::Vec3 myLocalCameraPos
Definition: DtWeatherLightning.h:329
unsigned int myRandomSeed
Definition: DtWeatherLightning.h:357