19 #include <osg/BlendFunc>
20 #include <osg/RenderInfo>
27 class DtWeatherEffectDrawable;
52 , myParametersUnfmLoc(0)
53 , mySoftnessUnfmLoc(0)
54 , myAdditiveBlend(false)
79 EffectTypePrecipitation = 0,
91 SurfaceHitTypeNone = 0,
120 virtual void init(
int particleCount,
float particleSize,
float radius, EffectType type);
123 virtual void releaseGLObjects(osg::State* state)
const;
129 virtual void simulationUpdate(
float timeStep,
double currentTime,
DtJobSplitter* jobSplitter);
134 virtual void postSimulationUpdate(
float timeStep,
double currentTime);
143 virtual void cullUpdate(
const osg::Vec3d& camPos,
const osg::Matrixd& basis,
DtJobSplitter* jobSplitter);
150 virtual void setSurfaceHitType(SurfaceHitType type);
155 virtual void setWind(
float windDirectionRad,
float windSpeedMps);
159 virtual void setWindSpeedMultiplier(
float multiplier);
163 virtual void setWindLiftMultiplier(
float multiplier);
167 virtual void setWindTurbulence(
float multiplier);
173 virtual void setStreak(
float multiplier);
179 virtual void setCameraStreakEnable(
bool enable);
183 virtual void setEffectFade(
float fade);
187 virtual void setIntensity(
float intensity);
196 virtual void setFadePerIntensity(
float fadeMin,
float fadeMax,
float intensityMin,
float intensityMax);
205 virtual void setFadePerWind(
float fadeMin,
float fadeMax,
float windMin,
float windMax);
214 virtual void setParticlesPerIntensity(
float percentMin,
float percentMax,
float intensityMin,
float intensityMax);
218 virtual void setColorMult(
float r,
float g,
float b);
222 virtual void setAdditiveBlend(
bool enable);
225 virtual bool additiveBlend()
const;
229 virtual void setVelocity(
float x,
float y,
float z);
233 virtual void setInitRotationVariation(
float rotationDeg);
236 virtual float radius()
const;
243 virtual void setTextureAtlasCell(
unsigned char numColumns,
unsigned char numRows,
unsigned char col,
unsigned char row);
247 virtual void setDepthSoftness(
float softness);
250 virtual float depthSoftness()
const;
254 virtual void setDragCoefficient(
float coefficient);
257 virtual float dragCoefficient()
const;
261 virtual void setSortEnable(
bool enable);
264 virtual bool sortEnable()
const;
268 virtual void runSort(
const osg::Vec3& localCamPos);
276 : myVboPositionArray(0)
278 , myVboTexCoords0Array(0)
280 myPoints =
new osg::Vec4Array;
281 myMove =
new osg::Vec4Array;
282 myTexCoords0 =
new osg::Vec2Array;
301 , myPosition(0, 0, 0, 0)
303 , myVelocity(0, 0, 0)
306 , myLifeTimeInit(1.0f)
346 virtual void runSimulationUpdateJob(
float timeStep,
double currentTime);
349 virtual void updateHailSurfaceHit(
float timeStep);
353 virtual void computeSortDepth(
const osg::Vec3& reference);
356 virtual void fillSortedParticles();
361 virtual bool bindMeshGroupData(
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
366 virtual bool bindDynamicMeshGroupData(
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
372 virtual bool bindVaoToMeshGroup(
GLuint vao,
MeshGroup* meshGroup, osg::RenderInfo& renderInfo)
const;
377 virtual void simulatePrecipitationParticles(
float timeStep,
double currentTime);
383 virtual void simulateParticles(
float timeStep,
double currentTime, osg::Vec3d& basisPosChange);
391 void wrapPosition(
float& posX,
float& posY,
float& posZ);
400 void freeParticle(
Particle* particle);
406 void spawnHailParticle(
const osg::Vec3d& position,
const osg::Vec3& normal,
bool usePhysics);
411 const osg::Vec3 crossProduct(
const osg::Vec3& v0,
const osg::Vec3& v1);
416 float computeRandomMinMax(
float fMin,
float fMax);
421 void computeRandomPointInRadius(osg::Vec2& point,
float radius);
428 bool clampPosition(osg::Vec3d& position, osg::Vec3& normal,
const osg::Vec3& up);
433 virtual float computeBlendControl(
const BlendData& data,
float blendPos)
const;
438 static void theSimulationUpdateJob(
void* data);
441 static int theSortBackToFront(
const void* arg0,
const void* arg1);
444 static void theSortJob(
void* data);
469 , myCameraPos(0, 0, 0)
569 static const std::string& theClassName();
float myLifeTimeInit
Definition: DtWeatherEffect.h:319
osg::ref_ptr< osg::BlendFunc > myBlendFunc
Definition: DtWeatherEffect.h:506
float myWindLiftMultiplier
Definition: DtWeatherEffect.h:493
osg::Vec3d myBasisPos
Definition: DtWeatherEffect.h:481
A structure used to define a mesh group (voa, positions, coords).
Definition: DtWeatherEffect.h:273
BlendData myFadeByIntensity
Definition: DtWeatherEffect.h:500
float myBlendMax
Definition: DtWeatherEffect.h:340
float myBlendMin
Definition: DtWeatherEffect.h:339
Virtual base class.
Definition: DtVirtualBaseClass.h:22
bool myAdditiveBlend
Definition: DtWeatherEffect.h:67
Particle ** myRenderList
Definition: DtWeatherEffect.h:527
Implementation independent random number generator.
Definition: DtRandomNumberGenerator.h:23
osg::Vec3 myCameraPos
Definition: DtWeatherEffect.h:475
osg::Vec3d myCamMove
Definition: DtWeatherEffect.h:63
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
bool myBasisDirty
Definition: DtWeatherEffect.h:483
SimulationUpdateJobData()
Definition: DtWeatherEffect.h:451
unsigned int myVboTexCoords0Array
Definition: DtWeatherEffect.h:291
bool mySortEnable
Definition: DtWeatherEffect.h:515
SortJobData()
Definition: DtWeatherEffect.h:467
A structure to hold data for a sorting job.
Definition: DtWeatherEffect.h:465
osg::ref_ptr< osg::Vec4Array > myMove
Definition: DtWeatherEffect.h:286
unsigned int GLuint
Definition: DtGlTextureBufferObject.h:17
DrawData()
Definition: DtWeatherEffect.h:47
float myTimeStep
Definition: DtWeatherEffect.h:460
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
Particle()
Definition: DtWeatherEffect.h:297
osg::Vec3d myCamPos
Definition: DtWeatherEffect.h:62
bool myCameraStreak
Definition: DtWeatherEffect.h:509
SurfaceHitType mySurfaceHitType
Definition: DtWeatherEffect.h:486
GLint myParametersUnfmLoc
Definition: DtWeatherEffect.h:65
DtWeatherEffect * myEffect
Definition: DtWeatherEffect.h:474
unsigned int myVboMoveArray
Definition: DtWeatherEffect.h:290
float myTextureAtlasRow
Definition: DtWeatherEffect.h:513
BlendData myParticlesByIntensity
Definition: DtWeatherEffect.h:502
osg::Vec3 myVelocity
Definition: DtWeatherEffect.h:316
float myTextureAtlasRows
Definition: DtWeatherEffect.h:511
bool myAdditiveBlend
Definition: DtWeatherEffect.h:505
float myTextureAtlasCols
Definition: DtWeatherEffect.h:510
DtRandomNumberGenerator myRandomNumberGen
Definition: DtWeatherEffect.h:536
creator for DtWeatherEffect
Definition: DtWeatherEffect.h:541
A structure used to hold data for drawing.
Definition: DtWeatherEffect.h:45
osg::Vec3d myLastBasisPos
Definition: DtWeatherEffect.h:482
float myInitRotationRad
Definition: DtWeatherEffect.h:497
Contains makVrv::DtVirtualBaseClass class.
A drawable for drawing weather effects such as hail.
Definition: DtWeatherEffectDrawable.h:36
Contains makVrv::DtRandomNumberGenerator class.
BlendData()
Definition: DtWeatherEffect.h:328
bool myStateDirty
Definition: DtWeatherEffect.h:68
osg::ref_ptr< osg::Vec4Array > myPoints
Definition: DtWeatherEffect.h:285
float myIntensity
Definition: DtWeatherEffect.h:499
osg::Vec3 myScroll
Definition: DtWeatherEffect.h:488
int myRenderParticleCount
Definition: DtWeatherEffect.h:528
SortJobData mySortJobData
Definition: DtWeatherEffect.h:533
Contains makVrv::DtJobSplitter class.
float myWindSpeedMultiplier
Definition: DtWeatherEffect.h:492
float myValueMax
Definition: DtWeatherEffect.h:338
DtJobSplitterJob mySimulationUpdateJob
Definition: DtWeatherEffect.h:531
float myNearClip
Definition: DtWeatherEffect.h:64
this class is used to create weather effects around the eye to represent effects such as mist...
Definition: DtWeatherEffect.h:40
float myWindTurbulence
Definition: DtWeatherEffect.h:494
float mySurfaceHitTimer
Definition: DtWeatherEffect.h:487
int myParticleActiveCount
Definition: DtWeatherEffect.h:525
EffectType
An enumeration to define the effect type.
Definition: DtWeatherEffect.h:77
float mySortDepth
Definition: DtWeatherEffect.h:313
A structure to hold blending control data for things like particle amount per intensity.
Definition: DtWeatherEffect.h:326
float myDepthSoftness
Definition: DtWeatherEffect.h:514
float myDragCoefficient
Definition: DtWeatherEffect.h:495
osg::Vec3 myVelocity
Definition: DtWeatherEffect.h:496
float myWindDirectionRad
Definition: DtWeatherEffect.h:490
A structure used to define a simulation particle.
Definition: DtWeatherEffect.h:295
osg::ref_ptr< osg::Vec2Array > myTexCoords0
Definition: DtWeatherEffect.h:287
float myTextureAtlasCol
Definition: DtWeatherEffect.h:512
float myEffectFade
Definition: DtWeatherEffect.h:498
Particle * myParent
Definition: DtWeatherEffect.h:311
double myCurrentTime
Definition: DtWeatherEffect.h:461
DtGlVaoManager * myVaoManager
Definition: DtWeatherEffect.h:518
GLint mySoftnessUnfmLoc
Definition: DtWeatherEffect.h:66
Particle * myParticlesActive
Definition: DtWeatherEffect.h:524
osg::Vec4 myMove
Definition: DtWeatherEffect.h:315
osg::Vec3 myColorMult
Definition: DtWeatherEffect.h:504
DtDe & myDe
Definition: DtWeatherEffect.h:572
bool myUsePhysics
Definition: DtWeatherEffect.h:317
osg::RenderInfo * myRenderInfo
Definition: DtWeatherEffect.h:61
float myWindSpeedMps
Definition: DtWeatherEffect.h:491
A structure to hold data for a simluation update job.
Definition: DtWeatherEffect.h:449
SimulationUpdateJobData mySimulationUpdateJobData
Definition: DtWeatherEffect.h:530
A generic structure to hold data for a job for use with DtJobSplitter.
Definition: DtJobSplitter.h:26
MeshGroup * myMeshGroup
Definition: DtWeatherEffect.h:517
float myStreakAdjustment
Definition: DtWeatherEffect.h:508
DtDe & myDe
Definition: DtWeatherEffect.h:478
This class is used to manage an opengl vertex array object (VAO) dealing with multiple opengl context...
Definition: DtGlVaoManager.h:49
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
float myLifeTime
Definition: DtWeatherEffect.h:318
float myRadius
Definition: DtWeatherEffect.h:489
Contains DLL export macros.
unsigned int myVboPositionArray
Definition: DtWeatherEffect.h:289
EffectType myEffectType
Definition: DtWeatherEffect.h:485
Particle * myParticlesMemoryPool
Definition: DtWeatherEffect.h:520
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
osg::Vec4 myPosition
Definition: DtWeatherEffect.h:314
float myParticleSize
Definition: DtWeatherEffect.h:503
SurfaceHitType
An enumeration to define a surface hit effect.
Definition: DtWeatherEffect.h:89
float myValueMin
Definition: DtWeatherEffect.h:337
BlendData myFadeByWind
Definition: DtWeatherEffect.h:501
Contains the DtGlVaoManager class declaration.
DtJobSplitterJob mySortJob
Definition: DtWeatherEffect.h:534
DtWeatherEffect * myEffect
Definition: DtWeatherEffect.h:459
int myParticleMemoryPoolCount
Definition: DtWeatherEffect.h:521
MeshGroup()
Definition: DtWeatherEffect.h:275
const DtWeatherEffectDrawable * myDrawable
Definition: DtWeatherEffect.h:69
Particle * myParticlesFree
Definition: DtWeatherEffect.h:523
float myStreak
Definition: DtWeatherEffect.h:507
osg::Matrixd myBasisRot
Definition: DtWeatherEffect.h:480
Particle * myChild
Definition: DtWeatherEffect.h:312