17 #include <osg/ref_ptr>
18 #include <osg/PositionAttitudeTransform>
20 #include <osg/BoundingBox>
22 #include <OsgST_Forest.h>
24 #include <unordered_set>
25 #include <unordered_map>
27 #include <tbb/mutex.h>
29 namespace makOsgSpeedTree
32 struct TreeInstanceDescriptor;
37 class DtAgentUpdateResolverInterface;
38 class DtSpeedTreeModelInstance;
39 class DtSpeedTreeCore;
40 class DtOsgCullVisitor;
41 class DtOsgCullVisitorParameters;
43 class DtCoordinateConverter;
45 class DtSkyObjectManager;
52 friend class DtSpeedTreeForestClassesCreator;
72 virtual void setVisible(
bool isVisible);
76 virtual void removeAllTrees();
79 virtual void removeAllUniqueTreesAndUniqueCell(
DtUniqueID cellID);
81 virtual void setTreeClippingPlane(
float fFar);
82 virtual void getTreeClippingPlane(
float& fFar);
84 virtual void setTree3DLodDistances(
float fNear,
float fFar);
85 virtual void getTree3DLodDistances(
float& fNear,
float& fFar);
87 virtual void setTreeBillboardDistances(
float fStart,
float fEnd);
88 virtual void getTreeBillboardDistances(
float& fStart,
float& fEnd);
91 virtual void setBillboardFadeOutRange(
float fRange);
93 virtual void getBillboardFadeOutRange(
float& fRange);
95 virtual void enableBillboardRendering(
bool enable);
96 virtual bool isBillboardRenderingEnabled()
const;
98 virtual void enable3DTreeRendering(
bool enable);
99 virtual bool is3DTreeRenderingEnabled()
const;
101 virtual void enableReceiveShadows(
bool enable);
104 virtual void setBoundingBox(
const osg::BoundingBox& box);
105 virtual const osg::BoundingBox& getBoundingBox(
void)
const;
114 const makOsgSpeedTree::TreeType* pTreeType,
uint32 programID);
118 virtual void slot_reloadShaders();
121 virtual void slot_treeProfilingChanged(
bool active);
124 virtual void slot_useGlobalAmbientChanged(
bool enabled);
127 virtual void slot_useGlobalDiffuseChanged(
bool enabled);
131 virtual void slot_perPixelLightingEnabledChanged(
bool enabled);
134 virtual void slot_planarReflectionsShowSpeedTreesChanged(
bool enabled);
137 virtual void processUninitialized();
140 virtual bool initialized();
143 virtual tbb::mutex& mergeDrawMutex();
146 virtual tbb::mutex& mergeUpdateMutex();
170 void init(
const std::string& strVisManagerType);
172 virtual void connectSignals(
void);
174 virtual osg::Vec3f computeWindDirection(
float fDirection);
176 virtual void setWindStrength(
float fStrength);
177 virtual void setWindDirection(
float fDirection);
184 virtual void preCullSetup(osg::Camera* osgCamera);
187 osg::RenderInfo& renderInfo);
189 osg::RenderInfo& renderInfo);
195 virtual void pushGraphicsState(osg::RenderInfo& renderInfo);
196 virtual void popGraphicsState(osg::RenderInfo& renderInfo);
203 virtual void initTreeDesc(makOsgSpeedTree::TreeInstanceDescriptor& desc,
207 virtual void initTreeDesc(makOsgSpeedTree::TreeInstanceDescriptor& desc,
209 virtual void applyModelDefParameters(makOsgSpeedTree::TreeInstanceDescriptor& desc,
220 virtual const bool bindLightingAttributes(
const osg::Node* node,
222 const std::string& searchNodeName);
225 virtual void enablePlanarReflections(
bool enable);
229 osg::RenderInfo& renderInfo);
234 static bool isReflectionCamera(osg::Camera* camera);
251 makOsgSpeedTree::TreeInstanceDescriptorCollection
279 typedef std::unordered_map<DtUniqueID, makOsgSpeedTree::TreeInstance*>
DtSpeedTreeForestObjectCreator is the SpeedTree implementation of a DtForestObjectCreator.
Definition: DtSpeedTreeForest.h:323
const std::string mySpeedTreeMultiViewUserFuncsVertexShader
Definition: DtSpeedTreeForest.h:292
MapModelDefToSTFileName myMapModelDefToSTFileName
Definition: DtSpeedTreeForest.h:256
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
static unsigned int theLastFrameShadersReloaded
Definition: DtSpeedTreeForest.h:247
static unsigned int theLastImGuiFrameNumber
Definition: DtSpeedTreeForest.h:243
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:91
float myFarPlane
Definition: DtSpeedTreeForest.h:266
#define DT_DLL_VRVST
Definition: vrvSt.h:20
std::unordered_map< int, bool > myShaderBoundMap
Definition: DtSpeedTreeForest.h:264
std::string strSRTFileName
Definition: DtSpeedTreeForest.h:158
DtCoordinateConverter is the base class for 'local (cig) to geocentric' converters.
Definition: DtCoordinateConverter.h:25
bool myReloadShaders
Should we reload the SpeedTree shaders.
Definition: DtSpeedTreeForest.h:287
makOsgSpeedTree::TreeInstanceDescriptor myScratchTreeInstanceDesc
Definition: DtSpeedTreeForest.h:250
const std::string mySpeedTreeDefaultUserFuncsPixelShader
Definition: DtSpeedTreeForest.h:290
Definition: DtSkyObjectManager.h:30
makOsgSpeedTree::TreeInstanceCollection myScratchInstanceCollection
Definition: DtSpeedTreeForest.h:253
Contains DLL export macros.
std::vector< DtTreeRecord * > DtVectorTreeRecords
Definition: DtTreeRecord.h:139
DtSpeedTreeCore & myCore
Definition: DtSpeedTreeForest.h:273
Contains makVrv::DtForestObject class.
DtForestObject provides a way to make lots of trees.
Definition: DtForestObject.h:26
osg::BoundingBox myBoundingBox
Definition: DtSpeedTreeForest.h:272
float modelDefScale
Definition: DtSpeedTreeForest.h:159
MapTreeIDToTree myMapTreeIDtoTree
Definition: DtSpeedTreeForest.h:281
DtSpeedTreeCore wraps and provides the interface to makOsgSpeedTree.
Definition: DtSpeedTreeCore.h:38
DtOsgCullVisitor will inspect the camera to see which visual mode is active. If the visual mode is a ...
Definition: DtOsgCullVisitor.h:27
static const float myCellSize
Definition: DtSpeedTreeForest.h:240
const std::string mySpeedTreeDefaultUserFuncsVertexShader
Definition: DtSpeedTreeForest.h:289
virtual bool isReceiveShadowsEnabled() const
Definition: DtSpeedTreeForest.h:102
A DtTreeRecord holds the requisite information needed to create a tree in a forest.
Definition: DtTreeRecord.h:30
DtSpeedTreeForest is the SpeedTree implementation of a distributed DtForestObject.
Definition: DtSpeedTreeForest.h:50
bool myReceiveShadows
Definition: DtSpeedTreeForest.h:299
unsigned int myRestoreVisibilityNodeMask
Definition: DtSpeedTreeForest.h:311
osg::ref_ptr< osg::PositionAttitudeTransform > myPat
Definition: DtSpeedTreeForest.h:270
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
The osg cull vistor parameters class provides additional culling and intersector parameters for choos...
Definition: DtOsgCullVisitorParameters.h:44
DtCoordinateConverter * myMergeBackgroundConverter
Definition: DtSpeedTreeForest.h:309
int myLastPerFrameUpdateFrameNumber
Definition: DtSpeedTreeForest.h:317
std::unordered_map< DtUniqueID, makOsgSpeedTree::TreeInstanceCollection > MapCellsToTrees
Definition: DtSpeedTreeForest.h:276
DtCoordinateConverter * myMainThreadConverter
Definition: DtSpeedTreeForest.h:308
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
MapCellsToTrees myMapCellsToTrees
Definition: DtSpeedTreeForest.h:277
DtSkyObjectManager & mySkyObjectManager
Definition: DtSpeedTreeForest.h:313
osg::ref_ptr< osg::Uniform > myNormalMatrixUniform
Definition: DtSpeedTreeForest.h:297
Base class to provide boost signal/slot management.
osg::Camera * myCamera
Definition: DtSpeedTreeForest.h:260
osg::ref_ptr< makOsgSpeedTree::Forest > myForest
Definition: DtSpeedTreeForest.h:271
makOsgSpeedTree::TreeInstanceDescriptorCollection myScratchTreeInstanceDescCollection
Definition: DtSpeedTreeForest.h:252
DtSignalConnectionManager myConnections
Definition: DtSpeedTreeForest.h:262
int myPreviousTU
Definition: DtSpeedTreeForest.h:258
unsigned int uint32
Definition: DtCommonTypes.h:28
The DtForestObjectCreator for the DtForestObject class.
Definition: DtForestObject.h:103
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
std::unordered_map< DtUniqueID, makOsgSpeedTree::TreeInstance * > MapTreeIDToTree
Definition: DtSpeedTreeForest.h:280
tbb::mutex myForestMergeDrawMutex
Definition: DtSpeedTreeForest.h:304
std::map< std::string, ModelDefParams > MapModelDefToSTFileName
Definition: DtSpeedTreeForest.h:255
Contains the DtCVMarkerSeries and DtCVMarkerSeries class declarations responsible for wrapping up to ...
osg::ref_ptr< osg::Uniform > myProjectionMatrixInverseUniform
Definition: DtSpeedTreeForest.h:294
Contains makVrv::DtTreeRecord class.
unsigned int myLastShaderHash
shader hash for the last shaders passed down to SpeedTree
Definition: DtSpeedTreeForest.h:284
bool myUpdateUserDefinedShaders
Definition: DtSpeedTreeForest.h:315
osg::ref_ptr< osg::Group > myRoot
The forest is a collection of trees under a group node.
Definition: DtSpeedTreeForest.h:269
Definition: DtSpeedTreeForest.h:156
tbb::mutex myForestMergeUpdateMutex
Definition: DtSpeedTreeForest.h:306
tbb::mutex myForestAddRemoveMutex
Definition: DtSpeedTreeForest.h:305