![]() |
VR-Forces Developer's Guide
|
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.

Classes | |
| struct | LightPointInfo |
Public Member Functions | |
| DtLightPointNode () | |
| DtLightPointNode (const DtLightPointNode &lpn, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
| virtual | ~DtLightPointNode () |
| META_Node (vrvOsg, DtLightPointNode) | |
| virtual void | traverse (osg::NodeVisitor &nv) |
| virtual void | updateDrawable (const osg::Camera *camera, int frameNum, double simTime, const osg::Matrixd &modelViewMatrix, osgUtil::CullVisitor *cv, int groupId, bool shouldCull, const DtIndirectFadeParameters &fadeParameters, float posScale, float radiusScale, bool isInstancedReflection=false) |
| virtual void | updateNodeInfo (bool isInstancedReflection=false, bool isForcedAdd=false) |
| virtual int | addTypedLightPoint (const osg::Vec3d &pos, int type, const std::string &id, const osg::Vec3 &rotation, float phaseShift) |
| virtual void | removeTypedLightPoint (int index) |
| virtual void | setLightPointManager (DtOsgLightPointManager *lightPointManager) |
| virtual DtOsgLightPointManager * | findLightPointManager () |
| virtual void | setLightPointsEnabled (bool enabled) |
| virtual bool | lightPointsEnabled () |
| virtual void | setGroupId (int id) |
| virtual int | groupId () |
| virtual void | freeNodeIdIfNecessary (unsigned int maxNodeIds) |
| virtual osg::BoundingSphere | computeBound () const |
| virtual void | applyMatrixToLightPoints (const osg::Matrix &adjustmentMatrix) |
| virtual void | applyMatrixToLightPointsIncremental (const osg::Matrix &adjustmentMatrix, int firstNodeToChange) |
| virtual void | setFadeParameters (const DtIndirectFadeParameters &fadeParameters) |
| virtual DtIndirectFadeParameters | fadeParameters () const |
| virtual int | lightPointCount () const |
| virtual osg::Vec3d | lightPointPosition (int index) const |
| virtual void | setLightPointPosition (int index, const osg::Vec3d &pos) |
| virtual int | lightPointType (int index) const |
| virtual int | lightPointNodeId () const |
| virtual int | lightPointGroupId (int index) const |
| virtual float | lightPointPhase (int index) const |
| virtual osg::Vec3 | lightPointSectorDir (int index) const |
| virtual const osg::Matrix3 & | lightPointSectorLocalToLp (int index) const |
| virtual void | setCameraRelativeLightsMode (bool mode=true) |
| virtual bool | cameraRelativeLightsMode () |
Protected Types | |
| typedef std::vector < LightPointInfo > | LightPointIntList |
Protected Member Functions | |
| virtual osg::BoundingSphere | computeBoundsIncremental (int firstNode) const |
Protected Attributes | |
| osg::BoundingBox | myMutableBoundingBox |
| osg::Vec3 | myMutableFurthestPoint |
| LightPointIntList | myLightPointTypeList |
| DtOsgLightPointManager * | myLightPointManager |
| osg::ref_ptr < DtLightPointDrawable > | myLightPointDrawable |
| std::vector< int > | myNodeIds |
| const osg::Camera * | myLastCamera |
| int | myFrameNum |
| int | myCurrentInstance |
| int | myAddedInstances |
| bool | myLightPointsEnabled |
| int | myGroupId |
| DtIndirectFadeParameters | myFadeParameters |
| float | myFirstFrameTime |
| bool | myCameraRelativeLightsMode |
| std::vector< int > | myFreeList |
| boost::recursive_mutex | myMutableNodeIdMutex |
Static Protected Attributes | |
| static int | theFrameNum |
| static const osg::Camera * | theLastCamera |
Private Member Functions | |
| DtLightPointNode & | operator= (const DtLightPointNode &other)=delete |
|
protected |
| makVrv::DtLightPointNode::DtLightPointNode | ( | ) |
Default constructor.
| 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 |
DTOR.
| makVrv::DtLightPointNode::META_Node | ( | vrvOsg | , |
| DtLightPointNode | |||
| ) |
|
privatedelete |
Assignment Operator Not implemented – Assignment Not Allowed.
|
virtual |
Traverse function which if called by the cull visitor then it sets up the Light Points to be drawn.
|
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 |
Copy DtLightPointNodeDataLayout to the light point node.
|
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. returns the index into the array to allow modifications later.
|
virtual |
removes the light point at this index. (currently puts it on a free list) only works for nodes in dynamic Lights Mode.
|
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 |
get the light point manager that this light point node is using.
|
virtual |
Turn all the light points for this node on or off.
|
virtual |
Are all the light points for this node on or off.
|
virtual |
Set the nodes group id. This overrides the light points individual group id unless it is set to 0.
|
virtual |
get the nodes group id.
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 |
Compute the bounds for this node based on all the light points it contains.
|
virtual |
Apply a matrix to the light point positions and sectors used by the optimizer to remove the matrix transforms above the light points.
|
virtual |
Incremental version of applyMatrixToLightPoints. This applies the matrix to only the nodes >= firstNodeToChange.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
set the lights to have position updated each frame, requires DtOsgRenderPassLocalSpaceTransform as a parent to the node
|
virtual |
|
protectedvirtual |
Internal, incremental computeLightPointBound. This is incremental because it is called from the incremental form ofapplyMatrixToLightPoints, and it would be expensive to recalculate the entire bound each time a few points were added.
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
staticprotected |
|
staticprotected |