PagedGeometry  1.2.0
Forests::WindBatchPage Class Reference

The WindBatchPage class renders entities as StaticGeometry with hardware accelerated wind animation capability. More...

#include <WindBatchPage.h>

Inheritance diagram for Forests::WindBatchPage:

Public Member Functions

void init (PagedGeometry *geom, const Ogre::Any &data)
 Replace pure virtual GeometryPage::init.
 
- Public Member Functions inherited from Forests::BatchPage
 BatchPage ()
 Default constructor.
 
void addEntity (Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale, const Ogre::ColourValue &color)
 Add an entity to the page, at the specified position, rotation, and scale. More...
 
void removeEntities ()
 Remove all geometry/entities from the page completely. More...
 
void build ()
 Perform any final steps to make added entities appear in the scene. More...
 
void setVisible (bool visible)
 Toggle the entire page's visibility. More...
 
void setFade (bool enabled, Ogre::Real visibleDist, Ogre::Real invisibleDist)
 Sets fade behavior for this page. More...
 
void addEntityToBoundingBox ()
 
void clearBoundingBox ()
 Advanced: Reset the bounding box used by addEntityToBoundingBox() More...
 
const Ogre::AxisAlignedBoxgetBoundingBox ()
 Advanced: Return the bounding box computed with addEntityToBoundingBox() More...
 
- Public Member Functions inherited from Forests::GeometryPage
void setQueryFlag (Ogre::uint32 flag)
 
bool hasQueryFlag ()
 
Ogre::uint32 getQueryFlag ()
 
virtual void setRegion (Ogre::Real left, Ogre::Real top, Ogre::Real right, Ogre::Real bottom)
 Prepare a geometry page for entities. More...
 
virtual void update ()
 Do whatever needs to be done to keep the page geometry up-to-date. More...
 
Ogre::Vector3getCenterPoint ()
 Gets the center point of the page. More...
 
bool isVisible ()
 Return the current visibility status of the page. More...
 
virtual void addEntityToBoundingBox (Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale)
 Advanced: Expand the current bounding box to include the given entity. More...
 
virtual ~GeometryPage ()
 Destructor This is defined here so the destructors of derived classes are called properly. More...
 
 GeometryPage ()
 Constructor Initialise everything to zero, false or NULL except for _trueBoundsUndefined that is set to true.
 

Protected Member Functions

void _updateShaders ()
 

Additional Inherited Members

- Protected Attributes inherited from Forests::BatchPage
PagedGeometrym_pPagedGeom
 
Ogre::SceneManagerm_pSceneMgr
 
BatchedGeometrym_pBatchGeom
 
size_t m_nLODLevel
 
bool m_bFadeEnabled
 
bool m_bShadersSupported
 
Ogre::Real m_fVisibleDist
 
Ogre::Real m_fInvisibleDist
 
TMaterials m_vecUnfadedMaterials
 
- Static Protected Attributes inherited from Forests::BatchPage
static unsigned long s_nRefCount = 0
 
static unsigned long s_nGUID = 0
 

Detailed Description

The WindBatchPage class renders entities as StaticGeometry with hardware accelerated wind animation capability.

This is one of the geometry page types included in the StaticGeometry engine. These page types should be added to a PagedGeometry object with PagedGeometry::addDetailLevel() so the PagedGeometry will know how you want your geometry displayed.

To use this page type, use:

PagedGeometry::addDetailLevel<WindBatchPage>(farRange, transitionLength, Ogre::Any(LODLevel));

This page type (WindBatchPage) is almost identical to BatchPage, except it includes additional code to support a hardware accelerated wind animation technique (through a vertex shader). To enable animation on your tree(s), use PagedGeometry::setCustomParam() to set the following parameters:

windFactorX - Horizontal tree sway magnitude windFactorY - Vertical tree sway magnitude

See Example 8 for a practical example of using WindBatchPage.

Special thanks to Wendigo Studios (www.wendigostudios.com) for donating this extension of BatchPage to the PagedGeometry project.