17 #include <osg/ref_ptr>
18 #include <osg/PositionAttitudeTransform>
20 #include <osg/BoundingBox>
22 #include <OsgST_Forest.h>
24 #include <unordered_set>
26 #include <tbb/mutex.h>
28 namespace makOsgSpeedTree
31 struct TreeInstanceDescriptor;
36 class DtAgentUpdateResolverInterface;
37 class DtSpeedTreeModelInstance;
38 class DtSpeedTreeCore;
39 class DtEnvironmentInfo;
40 class DtOsgCullVisitorParameters;
42 class DtCoordinateConverter;
50 friend class DtSpeedTreeForestClassesCreator;
70 virtual void setVisible(
bool isVisible);
74 virtual void removeAllTrees();
77 virtual void removeAllUniqueTreesAndUniqueCell(
DtUniqueID cellID);
79 virtual void setTreeClippingPlane(
float fFar);
80 virtual void getTreeClippingPlane(
float& fFar );
82 virtual void setTree3DLodDistances(
float fNear,
float fFar);
83 virtual void getTree3DLodDistances(
float& fNear,
float& fFar );
85 virtual void setTreeBillboardDistances(
float fStart,
float fEnd);
86 virtual void getTreeBillboardDistances(
float& fStart,
float& fEnd);
89 virtual void setBillboardFadeOutRange(
float fRange);
91 virtual void getBillboardFadeOutRange(
float& fRange);
93 virtual void enableBillboardRendering(
bool enable);
94 virtual bool isBillboardRenderingEnabled()
const;
96 virtual void enable3DTreeRendering(
bool enable);
97 virtual bool is3DTreeRenderingEnabled()
const;
99 virtual void enableReceiveShadows(
bool enable);
102 virtual void setBoundingBox(
const osg::BoundingBox& box);
103 virtual const osg::BoundingBox& getBoundingBox(
void)
const;
112 const makOsgSpeedTree::TreeType* pTreeType,
uint32 programID);
116 virtual void slot_reloadShaders();
119 virtual void slot_treeProfilingChanged(
bool active);
122 virtual void slot_useGlobalAmbientChanged(
bool enabled);
125 virtual void slot_useGlobalDiffuseChanged(
bool enabled);
129 virtual void slot_perPixelLightingEnabledChanged(
bool enabled);
132 virtual void slot_planarReflectionsShowSpeedTreesChanged(
bool enabled);
135 virtual void processUnitialized();
138 virtual bool initialized();
141 virtual tbb::mutex& mergeDrawMutex();
144 virtual tbb::mutex& mergeUpdateMutex();
173 void init(
const std::string& strVisManagerType);
175 virtual void connectSignals(
void);
177 virtual osg::Vec3f computeWindDirection(
float fDirection);
179 virtual void setWindStrength(
float fStrength);
180 virtual void setWindDirection(
float fDirection);
186 osg::RenderInfo& renderInfo);
188 osg::RenderInfo& renderInfo);
192 virtual void pushGraphicsState(osg::RenderInfo& renderInfo);
193 virtual void popGraphicsState(osg::RenderInfo& renderInfo);
197 const std::string& modelDef);
204 virtual void initTreeDesc(makOsgSpeedTree::TreeInstanceDescriptor& desc,
208 virtual void initTreeDesc(makOsgSpeedTree::TreeInstanceDescriptor& desc,
210 virtual void applyModelDefParameters(makOsgSpeedTree::TreeInstanceDescriptor& desc,
221 virtual const bool bindLightingAttributes(
const osg::Node* node,
223 const std::string& searchNodeName);
227 osg::RenderInfo& renderInfo);
232 static bool isReflectionCamera(osg::Camera *camera);
246 makOsgSpeedTree::TreeInstanceDescriptorCollection
275 typedef std::unordered_map<DtUniqueID, makOsgSpeedTree::TreeInstance*>
DtSpeedTreeForestObjectCreator is the SpeedTree implementation of a DtForestObjectCreator.
Definition: DtSpeedTreeForest.h:316
const std::string mySpeedTreeMultiViewUserFuncsVertexShader
Definition: DtSpeedTreeForest.h:288
MapModelDefToSTFileName myMapModelDefToSTFileName
Definition: DtSpeedTreeForest.h:251
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
osg::GLExtensions * myExt
Definition: DtSpeedTreeForest.h:295
static bool theEnableAsyncUpdate
Definition: DtSpeedTreeForest.h:242
static unsigned int theLastImGuiFrameNumber
Definition: DtSpeedTreeForest.h:241
The DtEnvironmentInfo class is responsible for holding data related to the environment such as sky li...
Definition: DtEnvironmentInfo.h:27
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:87
float myFarPlane
Definition: DtSpeedTreeForest.h:261
bool myShouldUpdateThisFrame
Definition: DtSpeedTreeForest.h:308
#define DT_DLL_VRVST
Definition: vrvSt.h:20
std::unordered_map< int, bool > myShaderBoundMap
Definition: DtSpeedTreeForest.h:259
std::string strSRTFileName
Definition: DtSpeedTreeForest.h:161
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:283
makOsgSpeedTree::TreeInstanceDescriptor myScratchTreeInstanceDesc
Definition: DtSpeedTreeForest.h:245
const std::string mySpeedTreeDefaultUserFuncsPixelShader
Definition: DtSpeedTreeForest.h:286
makOsgSpeedTree::TreeInstanceCollection myScratchInstanceCollection
Definition: DtSpeedTreeForest.h:248
Contains DLL export macros.
std::vector< DtTreeRecord * > DtVectorTreeRecords
Definition: DtTreeRecord.h:137
DtSpeedTreeCore & myCore
Definition: DtSpeedTreeForest.h:268
Contains makVrv::DtForestObject class.
DtForestObject provides a way to make lots of trees.
Definition: DtForestObject.h:26
osg::BoundingBox myBoundingBox
Definition: DtSpeedTreeForest.h:267
float modelDefScale
Definition: DtSpeedTreeForest.h:162
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:38
MapTreeIDToTree myMapTreeIDtoTree
Definition: DtSpeedTreeForest.h:277
DtSpeedTreeCore wraps and provides the interface to makOsgSpeedTree.
Definition: DtSpeedTreeCore.h:28
static const float myCellSize
Definition: DtSpeedTreeForest.h:238
const std::string mySpeedTreeDefaultUserFuncsVertexShader
Definition: DtSpeedTreeForest.h:285
virtual bool isReceiveShadowsEnabled() const
Definition: DtSpeedTreeForest.h:100
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:48
DtEnvironmentInfo & myEnvInfo
Definition: DtSpeedTreeForest.h:269
bool myReceiveShadows
Definition: DtSpeedTreeForest.h:296
unsigned int myRestoreVisibilityNodeMask
Definition: DtSpeedTreeForest.h:310
osg::ref_ptr< osg::PositionAttitudeTransform > myPat
Definition: DtSpeedTreeForest.h:265
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:42
DtCoordinateConverter * myMergeBackgroundConverter
Definition: DtSpeedTreeForest.h:306
std::unordered_map< DtUniqueID, makOsgSpeedTree::TreeInstanceCollection > MapCellsToTrees
Definition: DtSpeedTreeForest.h:272
DtCoordinateConverter * myMainThreadConverter
Definition: DtSpeedTreeForest.h:305
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
MapCellsToTrees myMapCellsToTrees
Definition: DtSpeedTreeForest.h:273
osg::ref_ptr< osg::Uniform > myNormalMatrixUniform
Definition: DtSpeedTreeForest.h:293
Base class to provide boost signal/slot management.
osg::Camera * myCamera
Definition: DtSpeedTreeForest.h:255
osg::ref_ptr< makOsgSpeedTree::Forest > myForest
Definition: DtSpeedTreeForest.h:266
makOsgSpeedTree::TreeInstanceDescriptorCollection myScratchTreeInstanceDescCollection
Definition: DtSpeedTreeForest.h:247
DtSignalConnectionManager myConnections
Definition: DtSpeedTreeForest.h:257
int myPreviousTU
Definition: DtSpeedTreeForest.h:253
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:70
std::unordered_map< DtUniqueID, makOsgSpeedTree::TreeInstance * > MapTreeIDToTree
Definition: DtSpeedTreeForest.h:276
tbb::mutex myForestMergeDrawMutex
Definition: DtSpeedTreeForest.h:301
std::map< std::string, ModelDefParams > MapModelDefToSTFileName
Definition: DtSpeedTreeForest.h:250
Contains the DtCVMarkerSeries and DtCVMarkerSeries class declarations responsible for wrapping up to ...
osg::ref_ptr< osg::Uniform > myProjectionMatrixInverseUniform
Definition: DtSpeedTreeForest.h:290
Contains makVrv::DtTreeRecord class.
unsigned int myLastShaderHash
shader hash for the last shaders passed down to SpeedTree
Definition: DtSpeedTreeForest.h:280
osg::ref_ptr< osg::Group > myRoot
The forest is a collection of trees under a group node.
Definition: DtSpeedTreeForest.h:264
Definition: DtSpeedTreeForest.h:159
tbb::mutex myForestMergeUpdateMutex
Definition: DtSpeedTreeForest.h:303
tbb::mutex myForestAddRemoveMutex
Definition: DtSpeedTreeForest.h:302