VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes
makVrv::DtLightPointNode Class Reference

Derived from osg::Node and is a replacement for the osgSim::LightPointNode represents a group of light points that share a common origin location. More...

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

Classes

struct  LightPointInfo
 structure for holding all the information required to describe a single light point. More...

Public Member Functions

 DtLightPointNode ()
 Default contructor.
 DtLightPointNode (const DtLightPointNode &lpn, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.
 META_Node (vrvOsg, DtLightPointNode)
virtual void traverse (osg::NodeVisitor &nv)
 Traverse function which if called by the cull visitor then it sets up the Light Points to be drawn.
virtual void updateDrawable (const osg::Camera *camera, int frameNum, double simTime, osg::Matrixf &modelViewMatrix, osgUtil::CullVisitor *cv, int groupId, bool shouldCull, float maxVisibleDistance, float posScale, float radiusScale, bool isInstancedReflection=false)
 Makes sure the drawable has enough instances and light points for this node and passes model view matrix to the Light Point Manager posScale is used to scale the position of the light point when model scaling is being used with instanced models radiusScale is used to scale the radius of the light point when model scaling is being used with any model.
virtual void addTypedLightPoint (const osg::Vec3d &pos, int type, std::string id, const osg::Vec3 &rotation, float phaseShift)
 add a typed light point to this node.
virtual void setLightPointManager (DtOsgLightPointManager *lightPointManager)
 keep a local copy of the light point manager pointer. Also needed since the Light Point Node does not have a reference to the DE.
virtual DtOsgLightPointManagerfindLightPointManager ()
 get the light point manager that this light point node is using.
virtual void setLightPointsEnabled (bool enabled)
 Turn all the light points for this node on or off.
virtual bool lightPointsEnabled ()
 Are all the light points for this node on or off.
virtual void setGroupId (int id)
 Set the nodes group id. This overrides the light points individual group id unless it is set to 0.
virtual int groupId ()
 get the nodes group id.
void freeNodeIdIfNecessary (unsigned int maxNodeIds)
 Free up some node Id's if there are more than maxNodeIds allocated.
virtual osg::BoundingSphere computeBound () const
 Compute the bounds for this node based on all the light points it contains.

Protected Types

typedef std::vector
< LightPointInfo
LightPointIntList

Protected Member Functions

virtual ~DtLightPointNode ()
 DTOR.

Protected Attributes

osg::BoundingBox myMutableBoundingBox
LightPointIntList myLightPointTypeList
DtOsgLightPointManagermyLightPointManager
osg::ref_ptr
< DtLightPointDrawable
myLightPointDrawable
std::vector< intmyNodeIds
const osg::Camera * myLastCamera
int myFrameNum
int myCurrentInstance
int myAddedInstances
bool myLightPointsEnabled
int myGroupId

Static Protected Attributes

static int theFrameNum
static const osg::Camera * theLastCamera

Detailed Description

Derived from osg::Node and is a replacement for the osgSim::LightPointNode represents a group of light points that share a common origin location.

In addition to their origin the light point node can group them for things like airport or runway groupings. traversal of this node by the cull visitor passes the view matrix to the light point manager to be placed in an SSBO. Instance manager uses updateDrawable to do the same thing that traversal does for the non instanced case.

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtLightPointNode::DtLightPointNode ( )

Default contructor.

makVrv::DtLightPointNode::DtLightPointNode ( const DtLightPointNode lpn,
const osg::CopyOp &  copyop = osg::CopyOp::SHALLOW_COPY 
)

Copy constructor using CopyOp to manage deep vs shallow copy.

virtual makVrv::DtLightPointNode::~DtLightPointNode ( )
protectedvirtual

DTOR.

Member Function Documentation

makVrv::DtLightPointNode::META_Node ( vrvOsg  ,
DtLightPointNode   
)
virtual void makVrv::DtLightPointNode::traverse ( osg::NodeVisitor &  nv)
virtual

Traverse function which if called by the cull visitor then it sets up the Light Points to be drawn.

virtual void makVrv::DtLightPointNode::updateDrawable ( const osg::Camera *  camera,
int  frameNum,
double  simTime,
osg::Matrixf &  modelViewMatrix,
osgUtil::CullVisitor *  cv,
int  groupId,
bool  shouldCull,
float  maxVisibleDistance,
float  posScale,
float  radiusScale,
bool  isInstancedReflection = false 
)
virtual

Makes sure the drawable has enough instances and light points for this node and passes model view matrix to the Light Point Manager posScale is used to scale the position of the light point when model scaling is being used with instanced models radiusScale is used to scale the radius of the light point when model scaling is being used with any model.

virtual void makVrv::DtLightPointNode::addTypedLightPoint ( const osg::Vec3d &  pos,
int  type,
std::string  id,
const osg::Vec3 &  rotation,
float  phaseShift 
)
virtual

add a typed light point to this node.

This currently does not work correctly if this node has already been drawn once. position and rotation are in light point node local space. So the light point node's transform is applied to to the light points before they are drawn. The model view matrix for the light point node does this and is passed down to the shader in the updateDrawable function.

virtual void makVrv::DtLightPointNode::setLightPointManager ( DtOsgLightPointManager lightPointManager)
virtual

keep a local copy of the light point manager pointer. Also needed since the Light Point Node does not have a reference to the DE.

virtual DtOsgLightPointManager* makVrv::DtLightPointNode::findLightPointManager ( )
virtual

get the light point manager that this light point node is using.

virtual void makVrv::DtLightPointNode::setLightPointsEnabled ( bool  enabled)
virtual

Turn all the light points for this node on or off.

virtual bool makVrv::DtLightPointNode::lightPointsEnabled ( )
virtual

Are all the light points for this node on or off.

virtual void makVrv::DtLightPointNode::setGroupId ( int  id)
virtual

Set the nodes group id. This overrides the light points individual group id unless it is set to 0.

virtual int makVrv::DtLightPointNode::groupId ( )
virtual

get the nodes group id.

void makVrv::DtLightPointNode::freeNodeIdIfNecessary ( unsigned int  maxNodeIds)

Free up some node Id's if there are more than maxNodeIds allocated.

This is used to free up the instanced model light points if a instance is free'd. The reason for using the max id instead of always removing a node id every time and instance is free'd is because the light point may have never been drawn so it may not need to be removed.

virtual osg::BoundingSphere makVrv::DtLightPointNode::computeBound ( ) const
virtual

Compute the bounds for this node based on all the light points it contains.

Member Data Documentation

osg::BoundingBox makVrv::DtLightPointNode::myMutableBoundingBox
mutableprotected
LightPointIntList makVrv::DtLightPointNode::myLightPointTypeList
protected
DtOsgLightPointManager* makVrv::DtLightPointNode::myLightPointManager
protected
osg::ref_ptr<DtLightPointDrawable> makVrv::DtLightPointNode::myLightPointDrawable
protected
std::vector<int> makVrv::DtLightPointNode::myNodeIds
protected
const osg::Camera* makVrv::DtLightPointNode::myLastCamera
protected
int makVrv::DtLightPointNode::myFrameNum
protected
int makVrv::DtLightPointNode::myCurrentInstance
protected
int makVrv::DtLightPointNode::myAddedInstances
protected
bool makVrv::DtLightPointNode::myLightPointsEnabled
protected
int makVrv::DtLightPointNode::myGroupId
protected
int makVrv::DtLightPointNode::theFrameNum
staticprotected
const osg::Camera* makVrv::DtLightPointNode::theLastCamera
staticprotected

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

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)