VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
makVrv::DtTacticalSmokeModelInstance Class Reference

A model instance of a tactical smoke cloud consisting of several puffs of smoke. More...

Inheritance diagram for makVrv::DtTacticalSmokeModelInstance:
Inheritance graph
[legend]

Public Member Functions

 DtTacticalSmokeModelInstance (DtDe &de)
 Initializing CTOR.
virtual ~DtTacticalSmokeModelInstance ()
 Virtual DTOR.
virtual void setBasePosition (const DtVector &v)
 Set base position for particles.
virtual bool realize (DtModelDefinition &definition)
 Attempt to realize the instance of this model from a definition.
virtual void setTexture (const std::string &txt)
 Set the texture for all particles of this puff.
virtual void setIntensity (const osg::Vec2 &range)
 Set the number of particles to emit each frame.
virtual void setSizes (const osg::Vec2 &range)
 Set the initial and final sizes of particles.
virtual void setRotations (const osg::Vec2 &range)
 Set the range of values for angular-velocity of particles.
virtual void setColors (const osg::Vec4 &ic, const osg::Vec4 &fc)
 Set the initial and final colors of particles.
virtual void setAlphaMultiplier (double alpha)
 Set an initial alpha value multiplier for particles.
virtual void setSpeed (double speed)
 Set a constant speed of the particles in meters per second.
virtual void setLifetime (double life)
 Set a constant lifetime of the particles in seconds.
virtual void addToConnector (DtOsgSceneConnector *connector)
 Tell the model instance to add itself to the provided node.
virtual bool removeFromConnector (DtOsgSceneConnector *connector)
 Tell the model instance to remove itself from the provided node.
virtual void setVisible (bool isVisible)
 Set the visible state of this object.
virtual void setPuffPosition (int puffIndex, const DtVector &position)
 Set the position of a smoke-puff of particles.
virtual void setOneSigmaDistance (int puffIndex, const DtVector &sigma)
 Set the one-sigma distance per orthogonal direction of a smoke-puff of particles.
virtual void setDensity (int puffIndex, double density)
 Set density of a smoke-puff of particles.
virtual void setWindDirection (const DtVector &winddir)
 Set the wind direction and intensity.
virtual void start ()
 Tell the model to start emitting particles.
virtual void stop ()
 Tell the model to stop emitting particles.
virtual void pause ()
 Freeze the particle emitters.
virtual void resume ()
 Resume the animation.
- Public Member Functions inherited from makVrv::DtOsgModelInstance
virtual ~DtOsgModelInstance ()
 DTOR.
virtual bool saveModelToFile (const std::string &filename) const
 Attempt to save the model to a file.
virtual void enableColorBlending (bool b)
 Enable / disable coloring on all models in the scene object Note about enableColorBlending: If this particular model has instancing enabled then this flag is set to false and color blending is handled by the instance manager.
virtual void setBlendColor (float r, float g, float b, float a)
 set the model's color
virtual void enableTexture (bool onOff)
virtual osg::Node * rootNode ()
 Get the model instance's root node.
virtual const osg::Node * rootNode () const
 Get the model instance's root node.
virtual osg::Node * sensorNode ()
 Get the model instance's sensor node, .
virtual const osg::Node * sensorNode () const
 Get the model instance's sensor node, .
virtual void addDynamicSensorRegion (const std::string &region)
 Add an active region state.
virtual void setDynamicSensorRegion (const std::string &region, bool state)
 Set the state of an active region.
virtual bool dynamicSensorRegion (const std::string &region)
 Get the current state of the specified sensor region.
SensorRegionStateMap const dynamicSensorRegionMap () const
 Get the map containing all regions and their current states.
- Public Member Functions inherited from makVrv::DtModelInstance
 DtModelInstance (DtDe &de)
 CTOR.
virtual ~DtModelInstance ()
 DTOR.
const std::string & realizedDefinitionName () const
 Get the name of the definition that this model instance was realized with.
const DtVectorboundingBoxExtents () const
 Get the bounding box extents of the model instance.
void getBoundingBoxExtents (double &x, double &y, double &z) const
 Get the bounding box extents of the model instance.
const DtVectorboundingBoxCenter () const
 Get the bounding box center of the model instance.
void getBoundingBoxCenter (double &x, double &y, double &z) const
 Get the bounding box center of the model instance.
void getBoundingBoxComponents (DtVector &minimum, DtVector &maximum)
virtual void setContributesToBound (bool trueOrFalse)
 Set whether this model instance contributes to an object's overall bounding volume.
bool contributesToBound () const
 Get whether this model instance contributes to an object's overall bounding volume.

Private Member Functions

void destroyEffect ()
 Remove effect from scene-graph, destroy children and destroy effect.

Private Attributes

osg::ref_ptr
< DtTacticalSmokeEffect
myCloud
osg::Vec3d myBasePosition

Friends

class DtTacticalSmokeModelInstanceCreator

Additional Inherited Members

- Public Types inherited from makVrv::DtOsgModelInstance
typedef boost::unordered_map
< std::string, bool
SensorRegionStateMap
 Dynamic Sensor Region methods.
- Static Public Member Functions inherited from makVrv::DtOsgModelInstance
static osg::Vec4 readVec4 (const std::string &paramName, const DtModelDefinition &definition)
static osg::Vec3 readVec3 (const std::string &paramName, const DtModelDefinition &definition)
- Public Attributes inherited from makVrv::DtOsgModelInstance
boost::signal< void(const
std::string &) > 
signal_dynamicSensorRegionAdded
 Signal raised when a dynamic sensor region is added.
boost::signal< void(const
std::string &, bool) > 
signal_dynamicSensorRegionChanged
 Signal raised when a dynamic sensor region's state changes.
- Public Attributes inherited from makVrv::DtModelInstance
boost::signal< void(DtModelInstance *)> signal_modelInstanceChanged
- Protected Member Functions inherited from makVrv::DtOsgModelInstance
virtual void updateColorBlending ()
 calls update color blending with the model root.
virtual void updateColorBlending (osg::Node *node)
virtual void enableTexture (osg::Node *root, bool onOff)
virtual void updateBoundingBoxViaContents ()
 DtOsgModelInstance (DtDe &de)
 CTOR.
virtual void setRootNode (osg::Node *node)
 Set the model instance's root node.
- Protected Attributes inherited from makVrv::DtOsgModelInstance
osg::ref_ptr< osg::Node > myModelRoot
osg::ref_ptr< osg::StateSet > myCachedState
SensorRegionStateMap mySensorRegionMap

Detailed Description

A model instance of a tactical smoke cloud consisting of several puffs of smoke.

See Also
DtTacticalSmokeEffect

Constructor & Destructor Documentation

makVrv::DtTacticalSmokeModelInstance::DtTacticalSmokeModelInstance ( DtDe de)

Initializing CTOR.

Parameters
[in]deis a reference to the display engine.
virtual makVrv::DtTacticalSmokeModelInstance::~DtTacticalSmokeModelInstance ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual void makVrv::DtTacticalSmokeModelInstance::setBasePosition ( const DtVector v)
virtual

Set base position for particles.

Particle positions will be stored at an offset from this position. After the first time this function is called, it is a no-op.

virtual bool makVrv::DtTacticalSmokeModelInstance::realize ( DtModelDefinition definition)
virtual

Attempt to realize the instance of this model from a definition.

Parameters
[in]definitionis the model definition.
Return values
trueif the instance was realized.
falseotherwise.

Reimplemented from makVrv::DtModelInstance.

virtual void makVrv::DtTacticalSmokeModelInstance::setTexture ( const std::string &  txt)
virtual

Set the texture for all particles of this puff.

Parameters
[in]txtis the texture filename.
virtual void makVrv::DtTacticalSmokeModelInstance::setIntensity ( const osg::Vec2 &  range)
virtual

Set the number of particles to emit each frame.

These values are spread across all puffs to create a random number of total particles to generate each second.

Parameters
[in]rangeis the min/max range multipliers, default (6, 12).
virtual void makVrv::DtTacticalSmokeModelInstance::setSizes ( const osg::Vec2 &  range)
virtual

Set the initial and final sizes of particles.

These values allow particles to grow or shrink over their lifetime.

Parameters
[in]rangeis the start/end sizes, default (1, 1).
virtual void makVrv::DtTacticalSmokeModelInstance::setRotations ( const osg::Vec2 &  range)
virtual

Set the range of values for angular-velocity of particles.

These values allow particles to rotate continuously over their lifetime. The angular-velocity should be specified in degrees.

Parameters
[in]rangeis the min/max angular-velocity, default (-10, 10).
virtual void makVrv::DtTacticalSmokeModelInstance::setColors ( const osg::Vec4 &  ic,
const osg::Vec4 &  fc 
)
virtual

Set the initial and final colors of particles.

These values allow particles to change colors over their lifetime.

Parameters
[in]icis the initial color, default (1.0, 1.0, 1.0, 1.0).
[in]fcis the final color, default (1.0, 1.0, 1.0, 1.0).
virtual void makVrv::DtTacticalSmokeModelInstance::setAlphaMultiplier ( double  alpha)
virtual

Set an initial alpha value multiplier for particles.

This is multiplied to starting alpha value of the particles, the ending value is always zero. The alpha value should be a normalized value from zero to one. Invalid values are clamped.

Parameters
[in]alphais the starting alpha value, default 1.0.
virtual void makVrv::DtTacticalSmokeModelInstance::setSpeed ( double  speed)
virtual

Set a constant speed of the particles in meters per second.

Setting this value fixes a constant speed of the particle while forcing each particle to have a variable lifetime.

Parameters
[in]speedis the constant speed of particles, default 0.25.
See Also
setLifetime(double).
virtual void makVrv::DtTacticalSmokeModelInstance::setLifetime ( double  life)
virtual

Set a constant lifetime of the particles in seconds.

Setting this value fixes a constant lifetime of the particle while forcing each particle to have a variable speed.

Parameters
[in]lifeis the constant lifetime of particles, default 40.
See Also
setSpeed(double).
virtual void makVrv::DtTacticalSmokeModelInstance::addToConnector ( DtOsgSceneConnector connector)
virtual

Tell the model instance to add itself to the provided node.

Parameters
[in]connectoris the scene-connector with the node.

Reimplemented from makVrv::DtOsgModelInstance.

virtual bool makVrv::DtTacticalSmokeModelInstance::removeFromConnector ( DtOsgSceneConnector connector)
virtual

Tell the model instance to remove itself from the provided node.

Parameters
[in]connectoris the scene-connector with the node.
Return values
trueif model instance was successfully removed.
falseotherwise.

Reimplemented from makVrv::DtOsgModelInstance.

virtual void makVrv::DtTacticalSmokeModelInstance::setVisible ( bool  isVisible)
virtual

Set the visible state of this object.

Parameters
[in]isVisibleis the new visible state.

Implements makVrv::DtModelInstance.

virtual void makVrv::DtTacticalSmokeModelInstance::setPuffPosition ( int  puffIndex,
const DtVector position 
)
virtual

Set the position of a smoke-puff of particles.

Parameters
[in]puffIndexis the id of the the particle effect.
[in]positionis the position of new particles.
virtual void makVrv::DtTacticalSmokeModelInstance::setOneSigmaDistance ( int  puffIndex,
const DtVector sigma 
)
virtual

Set the one-sigma distance per orthogonal direction of a smoke-puff of particles.

Parameters
[in]puffIndexis the id of the the particle effect.
[in]sigmais the distance in each direction where the probability of particle distribution within that distance is one-sigma (68.3%) from the emitting position.
virtual void makVrv::DtTacticalSmokeModelInstance::setDensity ( int  puffIndex,
double  density 
)
virtual

Set density of a smoke-puff of particles.

Parameters
[in]puffIndexis the id of the the particle effect.
[in]densityis the density of the particles where 1.0 is full density and 0.0 is no density (no smoke), default is 1.0.
virtual void makVrv::DtTacticalSmokeModelInstance::setWindDirection ( const DtVector winddir)
virtual

Set the wind direction and intensity.

Parameters
[in]winddiris the direction and intensity of the wind.
virtual void makVrv::DtTacticalSmokeModelInstance::start ( )
virtual

Tell the model to start emitting particles.

virtual void makVrv::DtTacticalSmokeModelInstance::stop ( )
virtual

Tell the model to stop emitting particles.

virtual void makVrv::DtTacticalSmokeModelInstance::pause ( )
virtual

Freeze the particle emitters.

virtual void makVrv::DtTacticalSmokeModelInstance::resume ( )
virtual

Resume the animation.

void makVrv::DtTacticalSmokeModelInstance::destroyEffect ( )
private

Remove effect from scene-graph, destroy children and destroy effect.

Friends And Related Function Documentation

Member Data Documentation

osg::ref_ptr<DtTacticalSmokeEffect> makVrv::DtTacticalSmokeModelInstance::myCloud
private
osg::Vec3d makVrv::DtTacticalSmokeModelInstance::myBasePosition
private

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)