![]() |
VR-Forces 5.0.2 Developer's Guide
|
An area of ground fog patch items and effects. One ground fog patch area is associated with a non-infinite ground fog cloud layer in the user interface. The area is made up of a rectangular 2d grid of ground fog patch items.
Optionally, ground fog particle effects are added to the area and activated as the camera moves through the area. This area object can be thought of as a manager for fog patches and effects that are within a specified bounds.
Note that sandstorms are also created using a ground fog patch area. The main differences between ground fog and sandstorms are the way the areas are configured such as base color and effects.
Classes | |
| struct | BoneWeight |
| struct | DrawData |
| struct | MeshGroup |
Public Types | |
| enum | AreaType { AreaTypePatchyGroundFog, AreaTypeSandstorm } |
Public Member Functions | |
| DtGroundFogPatchArea (makVrv::DtDe &de) | |
| virtual | ~DtGroundFogPatchArea () |
| virtual void | init (float worldSize, float thickness) |
| virtual void | addEffect (DtGroundFogEffect *effect) |
| virtual void | releaseFogPatchGLObjects (osg::State *state) const |
| virtual void | releaseFogEffectGLObjects (osg::State *state) const |
| virtual bool | cullUpdate (const osg::Vec3d &camPos, const osg::Matrixd &viewMatrixI, const std::vector< osg::Vec4d > &cullingPlanes, DtJobSplitter *jobSplitter) |
| virtual bool | shouldDrawFogPatches () |
| virtual void | drawFogPatches (DtGroundFogPatchArea::DrawData &drawData) |
| virtual void | drawFogEffects (DtGroundFogEffect::DrawData &drawData) |
| virtual void | setDensity (float density) |
| virtual float | density () const |
| virtual void | setTransform (const DtVector &position, float orientation, bool relativeToCamera=false) |
| virtual void | computeWorldTransform (osg::Vec3d &position, osg::Matrixf &rotation) const |
| virtual void | setEnabled (bool enabled) |
| virtual bool | enabled () const |
| virtual void | setClampingEnabled (bool enabled) |
| virtual bool | clampingEnabled () const |
| virtual float | worldSize () const |
| virtual float | computeParticleSize () const |
| virtual void | setBounds (const DtVector &bounds, float cornerRadius) |
| virtual bool | isPositionAboveArea (const osg::Vec3d &position) |
| virtual void | setBaseColor (float red, float green, float blue) |
| virtual void | setParticleSizeVariation (float variation) |
| virtual void | setPatternedLook (bool patternedEnable) |
| virtual void | setAreaType (DtGroundFogPatchArea::AreaType areaType) |
| virtual DtGroundFogPatchArea::AreaType | areaType () const |
| virtual void | computeBounds (osg::Vec4 &bounds, osg::Vec3d &position, osg::Matrixd &rotation) const |
Protected Member Functions | |
| virtual void | freeData (void) |
| virtual void | computeWeights (float x, float y, float patchSize, float *bones, float *weights) |
| virtual void | initLod (int gridSize, float patchSize) |
| virtual bool | bindMeshGroupData (MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const |
| virtual bool | bindVaoToMeshGroup (GLuint vao, MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const |
| virtual void | computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut) |
| virtual void | computeSortDepth (const osg::Vec3 &camPos) |
| virtual void | inverseTransformPlane (osg::Vec4d &plane, const osg::Vec3d &position, const osg::Matrixd &rotation) |
| virtual bool | isSphereVisible (const std::vector< osg::Vec4d > &planes, const osg::Vec3d ¢er, double radius) |
| virtual void | computeBoundsCulling () |
| virtual float | computeEffectFade (const osg::Vec3 &localCam) |
| virtual double | clampDistance () const |
| virtual bool | clampPosition (osg::Vec3d &position) |
| virtual float | computePatchCellSize () const |
Static Protected Member Functions | |
| static int | theSortWeights (const void *arg0, const void *arg1) |
| static int | theSortBackToFront (const void *arg0, const void *arg1) |
Protected Attributes | |
| DtDe & | myDe |
| float | myDensity |
| bool | myEnabled |
| float | myWindU |
| float | myWindV |
| double | myLastWindTime |
| bool | myCameraBasisDirty |
| bool | myInitialized |
| bool | myClampingEnabled |
| int | myClampIndex |
| int | myClampBoneIndex |
| float | myMaxClampOffset |
| float | myBaseColorR |
| float | myBaseColorG |
| float | myBaseColorB |
| float | myParticleSizeVariation |
| float | myPatternedLook |
| AreaType | myAreaType |
| MeshGroup * | myMeshGroup |
| DtGlVaoManager * | myVaoManager |
| osg::Vec3d | myPosition |
| float | myOrientation |
| osg::Vec3d | myBasisPos |
| osg::Matrixd | myBasisRot |
| float | myBoundsX |
| float | myBoundsY |
| float | myBoundsCornerRadius |
| int | myGridSize |
| float | myPatchWorldSize |
| std::vector< DtGroundFogPatch * > | myPatches |
| int | myPatchCount |
| DtGroundFogPatch ** | myRenderPatches |
| int | myRenderPatchCount |
| std::vector< DtGroundFogEffect * > | myEffects |
Static Protected Attributes | |
| static const double | DT_GFP_CLAMP_DISTANCE |
| static const int | DT_GFP_CELL_SIZE |
Private Member Functions | |
| DtGroundFogPatchArea () | |
| DtGroundFogPatchArea (const DtGroundFogPatchArea &other) | |
| DtGroundFogPatchArea & | operator= (const DtGroundFogPatchArea &other) |
| makVrv::DtGroundFogPatchArea::DtGroundFogPatchArea | ( | makVrv::DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
|
private |
Default Constructor not implemented.
|
private |
Copy Constructor not implemented - Copy not allowed.
|
private |
Assignment Operator not implemented - Assignment not allowed.
|
virtual |
Initializes the area.
| worldSize | The world size of 1 horizontal square side (meters). |
| thickness | The vertical height of the area (meters). |
|
virtual |
brief Adds an effect to this area.
| effect | This effect object to add. |
|
virtual |
Release all gl objects used by fog patches in this area.
|
virtual |
Release all gl objects used by fog effects in this area.
|
virtual |
Updates ground fog area based on the current camera.
| cam | The current camera being drawn. |
| jobSplitter | A job splitter to add predraw jobs to. returns true if visible. |
|
virtual |
Returns true if drawing of fog patches is allowed this draw.
|
virtual |
Do the drawing of fog patches.
|
virtual |
Do the drawing of fog effects.
|
virtual |
brief Set the fog density.
| density | This fog density exp() control. |
|
virtual |
brief Returns the fog density.
|
virtual |
Sets the fog area transform.
| position | The transform position in world space. |
| oritantation | The yaw orientation in degrees (0 = north). |
| relativeToCamera | Set to true if the position is relative to the current camera. |
|
virtual |
brief Computes the world transform for the fog volume origin. This includes any local tranform and geocentric transform.
|
virtual |
Enables or disables the fog patch area.
| enabled | Set to true to enable the area. |
|
virtual |
Returns the enabled state.
|
virtual |
Enables or disables fog clamping to terrain.
| enabled | Set to true to enable clamping. |
|
virtual |
Returns the clamping enabled state.
|
virtual |
Returns the world size of 1 side of the square area.
|
virtual |
Computes the particle size used for voxel filling.
|
virtual |
Sets the bounds of the area.
| bounds | The (x,y,z) of the bounds. |
| cornerRadius | The radius at each corner of the bounds. |
|
virtual |
Returns true if the given position is above the area peak.
| position | The position to test. |
|
virtual |
Sets the base material color for the area.
| red | The red component color to set in the range of (0.0 - 1.0). |
| green | The green component color to set in the range of (0.0 - 1.0). |
| blue | The blue component color to set in the range of (0.0 - 1.0). |
|
virtual |
Sets a size variation for particles used to fill voxel space.
| variation | The random variation (typically 0.0 to 0.5). |
|
virtual |
Enables or disables a patterned look (typically "true" for sandstorms). Setting this to true or false will determine how shading and patchiness are applied in the ground fog patch shader.
| patternedEnable | If true, enables a patterned look. |
|
virtual |
Sets a type for this area. The type is used for determining things like how the area looks in sensors. areaType The area type enumeration.
|
virtual |
Gets a area type for this area. The area type is used for determining things like how the area looks in sensors.
|
virtual |
Computes the bounds of the area.
| bounds | The output (width, length, height, corner radius). |
| position | The output world postition. |
| rotation | The output world rotation. |
|
protectedvirtual |
Frees resources associated with patches.
|
protectedvirtual |
Computes a skeletal weights for a local cell position.
| x | The x cell position. |
| y | The y cell position. |
| patchSize | The world size of a patch row. |
| weights | An array of 4 floats to be filled with best bone indices. |
| weights | An array of 4 floats to be filled with best best weights. |
|
protectedvirtual |
Initializes an lod for a patch.
| gridSize | The number of cells in 1 row of a patch. |
| patchSize | The world size of a patch row. |
|
protectedvirtual |
Binds the mesh group data to the vbo's.
| meshGroup | The mesh group object to bind. |
| renderInfo | The current rendering info. |
|
protectedvirtual |
Binds the given voa to vbo's for a mesh group.
| vao | The GL VAO handle. |
| meshGroup | The mesh group to bind. |
| renderInfo | The current rendering info. |
|
protectedvirtual |
Ccomputes a basis rotation matrix for the given geocentric position.
| inGeocentricPos | The geocentric reference position. |
| rotOut | The computed basis rotation transform. |
|
protectedvirtual |
Computes the sort depth for all patches.
| camPos | The camera position in local fog system space. |
|
protectedvirtual |
Transforms a plane into a local transform space.
| plane | The plane to transform. |
| position | The transform position. |
| rotation | the transform rotation. |
|
protectedvirtual |
Tests to see if a sphere is visible using the given frustum planes.
| planes | The frustum planes to test the sphere against. |
| center | The sphere center position. |
| radius | the sphere radius. |
|
protectedvirtual |
For each patch, computes if it is culled from the bounds and stores results.
|
protectedvirtual |
Computes and returns a (0.0 - 1.0) base on camera position inside the bounds.
|
protectedvirtual |
Returns the distance used for bone clamping to the terrain.
|
protectedvirtual |
Clamps a position to the terrain. Returns true on success.
| position | The position to clamp. |
|
protectedvirtual |
Computes the cell size used in a fog patch.
|
staticprotected |
Sort function used for sorting skeletal weights.
|
staticprotected |
Sort function used for qsorting patches.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |