11#ifndef __TreeLoader2D_H__
12#define __TreeLoader2D_H__
17#include <OgrePrerequisites.h>
78 void addTree(Ogre::Entity *entity,
const Ogre::Vector3 &position, Ogre::Degree yaw = Ogre::Degree(0), Ogre::Real scale = 1.0f,
void* userData = NULL);
88 void deleteTrees(
const Ogre::Vector3 &position, Ogre::Real radius = 0.001f, Ogre::Entity *type = NULL);
264 inline std::vector<TreeDef> &
_getGridPage(std::vector<TreeDef> *grid,
int x,
int z)
268 OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS,
269 "Grid dimension is out of bounds",
270 "TreeLoader2D::_getGridPage()");
276 inline void _setGridPage(std::vector<TreeDef> *grid,
int x,
int z,
const std::vector<TreeDef> &page)
280 OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS,
281 "Grid dimension is out of bounds",
282 "TreeLoader2D::_getGridPage()");
A 2D greyscale image that is assigned to a certain region of your world to represent color levels.
void setFilter(MapFilter filter)
Sets the filtering mode used for this color map.
A class which you extend to provide a callback function for loading entities.
A class providing highly optimized methods for rendering massive amounts of geometry.
A PageLoader-derived object you can use with PagedGeometry to easily place trees on your terrain.
void setMaximumScale(Ogre::Real maxScale)
Sets the maximum tree scale value.
void setColorMapFilter(MapFilter filter)
Sets the filtering mode used for the color map.
void setMinimumScale(Ogre::Real minScale)
Sets the minimum tree scale value.
Ogre::Real getMinimumScale() const
Gets the minimum tree scale value.
void * heightFunctionUserData
void deleteTrees(const Ogre::Vector3 &position, Ogre::Real radius=0.001f, Ogre::Entity *type=NULL)
Deletes trees within a certain radius of the given coordinates.
const TBounds & getBounds() const
Gets the tree boundary area.
std::pair< Ogre::Entity *, std::vector< TreeDef > * > PageGridListValue
void setColorMap(const Ogre::String &mapFile, MapChannel channel=CHANNEL_COLOR)
Sets the color map used to color trees.
void setHeightFunction(Ogre::Real(*heightFunction)(Ogre::Real x, Ogre::Real z, void *userData), void *userData=NULL)
Sets the height function used to calculate tree height coordinates.
Ogre::Real getMaximumScale() const
Gets the maximum tree scale value.
std::vector< TreeDef > & _getGridPage(std::vector< TreeDef > *grid, int x, int z)
void loadPage(PageInfo &page)
This should be overridden to load a specified region of entities.
void _setGridPage(std::vector< TreeDef > *grid, int x, int z, const std::vector< TreeDef > &page)
std::map< Ogre::Entity *, std::vector< TreeDef > * > pageGridList
void addTree(Ogre::Entity *entity, const Ogre::Vector3 &position, Ogre::Degree yaw=Ogre::Degree(0), Ogre::Real scale=1.0f, void *userData=NULL)
Adds an entity to the scene with the specified location, rotation, and scale.
Ogre::Real(* heightFunction)(Ogre::Real x, Ogre::Real z, void *userData)
ColorMap * getColorMap()
Gets a pointer to the color map being used.
std::map< Ogre::Entity *, std::vector< TreeDef > * >::iterator PageGridListIterator
MapFilter
Specifies the filtering method used to interpret property maps.
Ogre::TRect< Ogre::Real > TBounds
Define TBounds as a TRect using Real numeric units.
MapChannel
Specifies which color channel(s) to extract from an image.
@ CHANNEL_COLOR
Use the image's full RGB color information.
Useful page information supplied to a pageloader.