VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtLightPointNode.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include <vrvOsg/vrvOsg.h>
12 
14 
16 
17 namespace osgUtil
18 {
19  class CullVisitor;
20 }
21 
22 namespace makVrv
23 {
24  class DtDe;
25  class DtOsgLightPointManager;
26 
33  class DT_DLL_VRVOSG DtLightPointNode : public osg::Node
34  {
35  protected:
36 
39  {
40  public:
42  LightPointInfo(int type, std::string group, const osg::Vec3d& pos, const osg::Matrix3& sectorLocalToLp, float phase)
43  : myLightPointType(type)
44  , myLightPointGroup(group)
45  , myPosition(pos)
46  , mySectorLocalToLp(sectorLocalToLp)
47  , myPhaseShift(phase)
48  {
49  /*intentionally nop*/
50  }
51 
53  std::string myLightPointGroup;
54  osg::Vec3d myPosition;
55  osg::Matrix3 mySectorLocalToLp;
56  float myPhaseShift;
57  };
58 
59  typedef std::vector< LightPointInfo > LightPointIntList;
60 
61  public:
62 
65 
67  DtLightPointNode(const DtLightPointNode& lpn, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
68 
69  META_Node(vrvOsg, DtLightPointNode);
70 
72  virtual void traverse(osg::NodeVisitor& nv);
73 
77  virtual void updateDrawable(const osg::Camera* camera, int frameNum, double simTime, const osg::Matrixd &modelViewMatrix,
78  osgUtil::CullVisitor* cv, int groupId, bool shouldCull, const DtIndirectFadeParameters& fadeParameters, float posScale, float radiusScale, bool isInstancedReflection = false);
79 
84  virtual void addTypedLightPoint(const osg::Vec3d& pos, int type, const std::string& id,
85  const osg::Vec3& rotation, float phaseShift);
86 
88  virtual void setLightPointManager(DtOsgLightPointManager *lightPointManager);
89 
91  virtual DtOsgLightPointManager *findLightPointManager();
92 
94  virtual void setLightPointsEnabled(bool enabled);
95 
97  virtual bool lightPointsEnabled();
98 
100  virtual void setGroupId(int id);
101 
103  virtual int groupId();
104 
108  virtual void freeNodeIdIfNecessary(unsigned int maxNodeIds);
109 
111  virtual osg::BoundingSphere computeBound() const;
112 
114  virtual void setLightPointTexture(osg::Texture* texture);
115 
117  virtual void releaseGLObjects(osg::State* state = 0) const;
118 
121  virtual void applyMatrixToLightPoints(osg::Matrix& adjustmentMatrix);
122 
123  virtual void setFadeParameters(const DtIndirectFadeParameters& fadeParameters);
124 
125  virtual DtIndirectFadeParameters fadeParameters() const;
126 
127  protected:
128 
130  virtual ~DtLightPointNode();
131 
132  protected:
133  mutable osg::BoundingBox myMutableBoundingBox;
134 
136 
138 
140 
141  std::vector<int> myNodeIds;
142 
143  const osg::Camera* myLastCamera;
145 
148 
150 
152 
154  //needs to be mutable so that the texture id can be cleared in release gl objects.
155  mutable GLuint64 myMutableTextureId;
156 
158 
160 
161  protected:
162 
163  static int theFrameNum;
164  static const osg::Camera* theLastCamera;
165  };
166 }
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
GLuint64 myMutableTextureId
Definition: DtLightPointNode.h:155
DtOsgLightPointManager * myLightPointManager
Definition: DtLightPointNode.h:137
struct for holding the fade parameters used by the indirect rendering cull compute shader ...
Definition: DtGpuCullingAndLodDefines.h:21
LightPointInfo(int type, std::string group, const osg::Vec3d &pos, const osg::Matrix3 &sectorLocalToLp, float phase)
constructor for filling the structure with data
Definition: DtLightPointNode.h:42
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
std::vector< LightPointInfo > LightPointIntList
Definition: DtLightPointNode.h:59
Definition: featureContext.h:37
int myFrameNum
Definition: DtLightPointNode.h:144
osg::Vec3d myPosition
Definition: DtLightPointNode.h:54
osg::Matrix3 mySectorLocalToLp
Definition: DtLightPointNode.h:55
std::string myLightPointGroup
Definition: DtLightPointNode.h:53
DtIndirectFadeParameters myFadeParameters
Definition: DtLightPointNode.h:157
static int theFrameNum
Definition: DtLightPointNode.h:163
osg::BoundingBox myMutableBoundingBox
Definition: DtLightPointNode.h:133
DtOsgLightPointManager registers LightPoint nodes so their TBO can be created and updated in a single...
Definition: DtOsgLightPointManager.h:85
int myCurrentInstance
Definition: DtLightPointNode.h:146
LightPointIntList myLightPointTypeList
Definition: DtLightPointNode.h:135
Contains makVrv::DtLightPointDrawable class.
osg::ref_ptr< osg::Texture > myLightPointTexture
Definition: DtLightPointNode.h:153
int myGroupId
Definition: DtLightPointNode.h:151
static const osg::Camera * theLastCamera
Definition: DtLightPointNode.h:164
Derived from osg::Node and is a replacement for the osgSim::LightPointNode represents a group of ligh...
Definition: DtLightPointNode.h:33
Declarations for classes used in DtICullingAndLOD.
float myPhaseShift
Definition: DtLightPointNode.h:56
float myFirstFrameTime
Definition: DtLightPointNode.h:159
bool myLightPointsEnabled
Definition: DtLightPointNode.h:149
structure for holding all the information required to describe a single light point.
Definition: DtLightPointNode.h:38
Contains DLL export macros.
int myLightPointType
Definition: DtLightPointNode.h:52
int myAddedInstances
Definition: DtLightPointNode.h:147
osg::ref_ptr< DtLightPointDrawable > myLightPointDrawable
Definition: DtLightPointNode.h:139
const osg::Camera * myLastCamera
Definition: DtLightPointNode.h:143
std::vector< int > myNodeIds
Definition: DtLightPointNode.h:141

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)