VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDiGuyOctreeCullGroup.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <osg/Group>
13 #include <osg/OperationThread>
14 #include <osg/Matrix>
15 
16 #include <vrvDiGuy/vrvDiGuy.h>
17 
20 
21 #include <tbb/concurrent_vector.h>
22 #include <tbb/mutex.h>
23 #include <tbb/task.h>
24 
25 namespace makVrv
26 {
27  class DtOsgCullVisitor;
28  class DtDiGuyScenario;
29  class DtDe;
30  class DtDiGuyOsgRootNode;
31  class DtDiGuyInstanceDrawable;
32 
36  {
38  DtDiGuyCullData(DtOsgCullVisitor* dtcv, float culldistance);
39  osg::Matrixd myProjectionMatrix;
40  osg::Matrixd myViewMatrix;
41  osg::Vec3d myCameraPosition;
42  float myCameraMag;
43  unsigned int myTraversalNum;
44  };
45 
48  class DT_DLL_VRVDIGUY DtDiGuyInstanceTboUpdaterJob : public osg::Operation
49  {
50  public:
53 
56 
60  virtual void operator () (osg::Object* sv);
61 
62  private:
63 
70 
71  protected:
74  };
75 
78  class DT_DLL_VRVDIGUY DtDiGuyOctreeCullGroup : public osg::Group
79  {
80  public:
81 
82  DtDiGuyOctreeCullGroup(DtDiGuyScenario& scenario, tbb::concurrent_vector< DtDiGuyOsgRootNode*>& noninstancedarray,
83  DtDiGuyInstanceDrawable& instanceDrawable);
84 
85  virtual void traverse(osg::NodeVisitor& nv);
86  virtual void precull(const DtDiGuyCullData& pcd, bool async);
87  virtual void setCullNeedsToRun(bool needsToRun);
88 
89  friend class DtDiGuyCullAsyncTask;
90  friend class DtDiguyPreCullJob;
91 
92  protected:
93 
97  tbb::concurrent_vector< DtDiGuyOsgRootNode*>& myNoninstancedNodeArray;
98  tbb::mutex myAsyncMutex;
100  };
101 
102 
103 
106  class DT_DLL_VRVDIGUY DtDiguyPreCullJob : public osg::Operation
107  {
108  public:
111 
112  private:
116  DtDiguyPreCullJob(const DtDiguyPreCullJob &other);
118  DtDiguyPreCullJob &operator=(const DtDiguyPreCullJob &other);
119 
120  public:
121 
123  virtual void operator () (osg::Object* sv);
124 
125  protected:
129 
130  };
131 
132 
135  class DtDiGuyCullAsyncTask : public tbb::task
136  {
137 
138  public:
140  DtDiGuyCullAsyncTask(DtDiGuyOctreeCullGroup& group, DtDiGuyScenario& dtscenario, osg::Object* object);
141 
143  virtual tbb::task* execute();
144 
145  public:
146 
147  protected:
151  };
152 
153 }
data that&#39;s passed around for culling
Definition: DtDiGuyOctreeCullGroup.h:35
DtDiGuyCullData myPrecullData
Definition: DtDiGuyOctreeCullGroup.h:149
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:73
int myMaxThreadCount
Definition: DtDiGuyOctreeCullGroup.h:128
Definition: featureContext.h:37
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:150
custom traversal and timings for diguy attach point
Definition: DtDiGuyOctreeCullGroup.h:78
DtDiGuyOctreeCullGroup & myGroup
Definition: DtDiGuyOctreeCullGroup.h:126
Contains DLL export macros.
async cull task started by DtDiguyPreCullJob
Definition: DtDiGuyOctreeCullGroup.h:135
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:94
responsible for starting culling code off in a seperate thread when culling starts ...
Definition: DtDiGuyOctreeCullGroup.h:106
osg::Matrixd myProjectionMatrix
Definition: DtDiGuyOctreeCullGroup.h:39
osg::ref_ptr< DtDiGuyInstanceTboUpdaterJob > myTboMainThreadUpdaterJob
Definition: DtDiGuyOctreeCullGroup.h:95
osg::Vec3d myCameraPosition
Definition: DtDiGuyOctreeCullGroup.h:41
DtOsgCullVisitor will inspect the camera to see which visual mode is active.
Definition: DtOsgCullVisitor.h:25
DtOctree class.
OctreeNode class.
DtDe & myDe
Definition: DtDiGuyOctreeCullGroup.h:72
bool myCullNeedsToRun
Definition: DtDiGuyOctreeCullGroup.h:99
osg::Matrixd myViewMatrix
Definition: DtDiGuyOctreeCullGroup.h:40
DtDiGuyCullData()
Definition: DtDiGuyOctreeCullGroup.h:37
DtDiGuyScenario & myScenario
Definition: DtDiGuyOctreeCullGroup.h:127
tbb::concurrent_vector< DtDiGuyOsgRootNode * > & myNoninstancedNodeArray
Definition: DtDiGuyOctreeCullGroup.h:97
unsigned int myTraversalNum
Definition: DtDiGuyOctreeCullGroup.h:43
creator class for DtInstanceManagerTboUpdater
Definition: DtInstanceManagerTboUpdater.h:59
float myCameraMag
Definition: DtDiGuyOctreeCullGroup.h:42
virtual tbb::task * execute()
runs the task
Class that renders all the diguy instance objects in one osg drawable, major performance improvement...
Definition: DtDiGuyInstanceDrawable.h:26
DtDiGuyCullAsyncTask(DtDiGuyOctreeCullGroup &group, DtDiGuyScenario &dtscenario, osg::Object *object)
creates the task
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
#define DT_DLL_VRVDIGUY
Definition: vrvDiGuy.h:21
DtDiGuyInstanceDrawable & myInstanceDrawable
Definition: DtDiGuyOctreeCullGroup.h:96
responsible for updating the TBO in the main thread spawned when data is ready
Definition: DtDiGuyOctreeCullGroup.h:48
tbb::mutex myAsyncMutex
Definition: DtDiGuyOctreeCullGroup.h:98
Owns a DiGuy scenario for the application.
Definition: DtDiGuyScenario.h:73
DtDiGuyOctreeCullGroup & myGroup
Definition: DtDiGuyOctreeCullGroup.h:148

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)