VR-Forces 4.6.1 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) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include <vrvOsg/vrvOsg.h>
12 
14 
15 namespace osgUtil
16 {
17  class CullVisitor;
18 }
19 
20 namespace makVrv
21 {
22  class DtDe;
23  class DtOsgLightPointManager;
24 
31  class DT_DLL_VRVOSG DtLightPointNode : public osg::Node
32  {
33  protected:
34 
37  {
38  public:
40  LightPointInfo(int type, std::string group, const osg::Vec3d& pos, const osg::Matrix3& sectorLocalToLp, float phase)
41  : myLightPointType(type)
42  , myLightPointGroup(group)
43  , myPosition(pos)
44  , mySectorLocalToLp(sectorLocalToLp)
45  , myPhaseShift(phase)
46  {
47  /*intentionally nop*/
48  }
49 
51  std::string myLightPointGroup;
52  osg::Vec3d myPosition;
53  osg::Matrix3 mySectorLocalToLp;
54  float myPhaseShift;
55  };
56 
57  typedef std::vector< LightPointInfo > LightPointIntList;
58 
59  public:
60 
63 
65  DtLightPointNode(const DtLightPointNode& lpn, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
66 
67  META_Node(vrvOsg, DtLightPointNode);
68 
70  virtual void traverse(osg::NodeVisitor& nv);
71 
75  virtual void updateDrawable(const osg::Camera* camera, int frameNum, double simTime, osg::Matrixf &modelViewMatrix,
76  osgUtil::CullVisitor* cv, int groupId, bool shouldCull, float maxVisibleDistance, float posScale, float radiusScale, bool isInstancedReflection = false);
77 
82  virtual void addTypedLightPoint(const osg::Vec3d& pos, int type, std::string id,
83  const osg::Vec3& rotation, float phaseShift);
84 
86  virtual void setLightPointManager(DtOsgLightPointManager *lightPointManager);
87 
89  virtual DtOsgLightPointManager *findLightPointManager();
90 
92  virtual void setLightPointsEnabled(bool enabled);
93 
95  virtual bool lightPointsEnabled();
96 
98  virtual void setGroupId(int id);
99 
101  virtual int groupId();
102 
106  void freeNodeIdIfNecessary(unsigned int maxNodeIds);
107 
109  virtual osg::BoundingSphere computeBound() const;
110 
111  protected:
112 
114  virtual ~DtLightPointNode();
115 
116  protected:
117  mutable osg::BoundingBox myMutableBoundingBox;
118 
120 
122 
123  osg::ref_ptr<DtLightPointDrawable> myLightPointDrawable;
124 
125  std::vector<int> myNodeIds;
126 
127  const osg::Camera* myLastCamera;
129 
132 
134 
136 
137  protected:
138 
139  static int theFrameNum;
140  static const osg::Camera* theLastCamera;
141  };
142 }

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)