![]() |
VR-Forces 4.0.4 Class Documentation
|
DtSpeedTreeDrawable draws a SpeedTree forest. More...

Classes | |
| struct | TreeInstanceRecord |
| A small struct containing the requisite attributes of a tree instance. More... | |
Public Types | |
| typedef std::vector < TreeInstanceRecord > | TreeInstanceRecordVector |
Public Member Functions | |
| DtSpeedTreeDrawable (DtDe &de, DtSpeedTreeForest *forestModel, const std::string &speedTreeDataPathRoot, int randomSeed) | |
| CTOR which takes the path to the speed tree data directory containing forests and shaders. | |
| DtSpeedTreeDrawable (const DtSpeedTreeDrawable &orig, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
| Copy constructor using CopyOp to manage deep vs shallow copy. | |
| virtual osg::Object * | cloneType () const |
| virtual osg::Object * | clone (const osg::CopyOp ©op) const |
| virtual bool | isSameKindAs (const osg::Object *obj) const |
| virtual const char * | libraryName () const |
| virtual const char * | className () const |
| virtual | ~DtSpeedTreeDrawable () |
| DTOR. | |
| virtual void | setProfile (int profile) |
| Set the tree profile (1-4). Fastest to Nicest looking. | |
| virtual void | drawImplementation (osg::RenderInfo &) const |
| The drawImplementation method is where the OSG wraps up the drawing of OpenGL primitives. | |
| virtual void | setTreesHaveChanged (bool bFlag) |
| Set this to true and during drawImplementation() this will rebuild the forest. | |
| virtual bool | treesHaveChanged () const |
| True if trees have been changed and forest needs to be rebuilt. | |
| virtual osg::BoundingBox | computeBound () const |
| Compute the bounding box of the drawbable. | |
| virtual void | setTreeClippingPlane (float fFar) |
| Set the distance that trees are clipped. | |
| virtual void | setTreeLodDistances (float fNear, float fFar) |
| Set the distances for tree LOD's. | |
| virtual DtSpeedTreeForest * | forest () |
| forest accessor. | |
| virtual void | releaseGLObjects (osg::State *state=0) const |
| If State is non-zero, this function releases OpenGL objects for the specified graphics context. | |
Protected Types | |
| typedef std::map< unsigned int, DtSpeedTreeProfile * > | ContextSpecificForestMap |
Protected Member Functions | |
| void | rebuildForest (DtSpeedTreeProfile *profile) |
| Rebuild a TreeInstanceRecordVector and call populateForest() with it. | |
| DtSpeedTreeProfile * | getCurrentProfile (unsigned int contextId) const |
| void | setCurrentProfile (unsigned int contextId, DtSpeedTreeProfile *profile) |
| void | flushGLObjects (unsigned int contextID) const |
| void | createProfile (unsigned int contextId) |
| void | populateForest (DtSpeedTreeProfile *profile, const TreeInstanceRecordVector &recordVector) |
| bool | addTree (const TreeInstanceRecord &record) |
Protected Attributes | |
| DtDe & | myDe |
| bool | myTreesHaveChanged |
| DtSpeedTreeForest * | myForestModel |
| ContextSpecificForestMap | myCurrentProfile |
| bool | myProfileHasChanged |
| int | myProfileId |
| int | myRandomSeed |
| float | myFarPlane |
| float | myNearLod |
| float | myFarLod |
Friends | |
| class | DtSpeedTreeProfile |
DtSpeedTreeDrawable draws a SpeedTree forest.
| typedef std::vector<TreeInstanceRecord> makVrv::DtSpeedTreeDrawable::TreeInstanceRecordVector |
typedef std::map<unsigned int, DtSpeedTreeProfile*> makVrv::DtSpeedTreeDrawable::ContextSpecificForestMap [protected] |
| makVrv::DtSpeedTreeDrawable::DtSpeedTreeDrawable | ( | DtDe & | de, |
| DtSpeedTreeForest * | forestModel, | ||
| const std::string & | speedTreeDataPathRoot, | ||
| int | randomSeed | ||
| ) |
CTOR which takes the path to the speed tree data directory containing forests and shaders.
| makVrv::DtSpeedTreeDrawable::DtSpeedTreeDrawable | ( | const DtSpeedTreeDrawable & | orig, |
| const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
| ) |
Copy constructor using CopyOp to manage deep vs shallow copy.
| virtual makVrv::DtSpeedTreeDrawable::~DtSpeedTreeDrawable | ( | ) | [virtual] |
DTOR.
| virtual osg::Object* makVrv::DtSpeedTreeDrawable::cloneType | ( | ) | const [inline, virtual] |
| virtual osg::Object* makVrv::DtSpeedTreeDrawable::clone | ( | const osg::CopyOp & | copyop | ) | const [inline, virtual] |
| virtual bool makVrv::DtSpeedTreeDrawable::isSameKindAs | ( | const osg::Object * | obj | ) | const [inline, virtual] |
| virtual const char* makVrv::DtSpeedTreeDrawable::libraryName | ( | ) | const [inline, virtual] |
| virtual const char* makVrv::DtSpeedTreeDrawable::className | ( | ) | const [inline, virtual] |
| virtual void makVrv::DtSpeedTreeDrawable::setProfile | ( | int | profile | ) | [virtual] |
Set the tree profile (1-4). Fastest to Nicest looking.
| virtual void makVrv::DtSpeedTreeDrawable::drawImplementation | ( | osg::RenderInfo & | ) | const [virtual] |
The drawImplementation method is where the OSG wraps up the drawing of OpenGL primitives.
| virtual void makVrv::DtSpeedTreeDrawable::setTreesHaveChanged | ( | bool | bFlag | ) | [virtual] |
Set this to true and during drawImplementation() this will rebuild the forest.
| virtual bool makVrv::DtSpeedTreeDrawable::treesHaveChanged | ( | ) | const [virtual] |
True if trees have been changed and forest needs to be rebuilt.
| virtual osg::BoundingBox makVrv::DtSpeedTreeDrawable::computeBound | ( | ) | const [virtual] |
Compute the bounding box of the drawbable.
This is so that the scene graph knows where this objects is, for both positioning the camera at start up, and most importantly for culling.
| virtual void makVrv::DtSpeedTreeDrawable::setTreeClippingPlane | ( | float | fFar | ) | [virtual] |
Set the distance that trees are clipped.
Since trees are expensive, they have their own clipping distances.
| virtual void makVrv::DtSpeedTreeDrawable::setTreeLodDistances | ( | float | fNear, |
| float | fFar | ||
| ) | [virtual] |
Set the distances for tree LOD's.
the near LOD plane. fFar is set using world units, determine solely by the application.
| virtual DtSpeedTreeForest* makVrv::DtSpeedTreeDrawable::forest | ( | ) | [virtual] |
forest accessor.
| virtual void makVrv::DtSpeedTreeDrawable::releaseGLObjects | ( | osg::State * | state = 0 | ) | const [virtual] |
If State is non-zero, this function releases OpenGL objects for the specified graphics context.
Otherwise, releases OpenGL objects for all graphics contexts.
| void makVrv::DtSpeedTreeDrawable::rebuildForest | ( | DtSpeedTreeProfile * | profile | ) | [protected] |
Rebuild a TreeInstanceRecordVector and call populateForest() with it.
Called by drawImplementation() when myTreesHaveChanged.
| DtSpeedTreeProfile* makVrv::DtSpeedTreeDrawable::getCurrentProfile | ( | unsigned int | contextId | ) | const [protected] |
| void makVrv::DtSpeedTreeDrawable::setCurrentProfile | ( | unsigned int | contextId, |
| DtSpeedTreeProfile * | profile | ||
| ) | [protected] |
| void makVrv::DtSpeedTreeDrawable::flushGLObjects | ( | unsigned int | contextID | ) | const [protected] |
| void makVrv::DtSpeedTreeDrawable::createProfile | ( | unsigned int | contextId | ) | [protected] |
| void makVrv::DtSpeedTreeDrawable::populateForest | ( | DtSpeedTreeProfile * | profile, |
| const TreeInstanceRecordVector & | recordVector | ||
| ) | [protected] |
| bool makVrv::DtSpeedTreeDrawable::addTree | ( | const TreeInstanceRecord & | record | ) | [protected] |
friend class DtSpeedTreeProfile [friend] |
DtDe& makVrv::DtSpeedTreeDrawable::myDe [protected] |
bool makVrv::DtSpeedTreeDrawable::myTreesHaveChanged [protected] |
ContextSpecificForestMap makVrv::DtSpeedTreeDrawable::myCurrentProfile [mutable, protected] |
bool makVrv::DtSpeedTreeDrawable::myProfileHasChanged [protected] |
int makVrv::DtSpeedTreeDrawable::myProfileId [protected] |
int makVrv::DtSpeedTreeDrawable::myRandomSeed [protected] |
float makVrv::DtSpeedTreeDrawable::myFarPlane [protected] |
float makVrv::DtSpeedTreeDrawable::myNearLod [protected] |
float makVrv::DtSpeedTreeDrawable::myFarLod [protected] |