Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Public Member Functions
Forests::RandomTreeLoader Class Reference

Description

Definition at line 37 of file RandomTreeLoader.h.

+ Inheritance diagram for Forests::RandomTreeLoader:

Public Member Functions

 RandomTreeLoader (PagedGeometry *geom, const TBounds &bounds)
 
 ~RandomTreeLoader ()
 
void loadPage (PageInfo &page)
 
void unloadPage (PageInfo &page)
 
- Public Member Functions inherited from Forests::TreeLoader2D
 TreeLoader2D (PagedGeometry *geom, const TBounds &bounds)
 
 ~TreeLoader2D ()
 
void addTree (Ogre::Entity *entity, const Ogre::Vector3 &position, Ogre::Degree yaw=Ogre::Degree(0), Ogre::Real scale=1.0f, void *userData=NULL)
 
void deleteTrees (const Ogre::Vector3 &position, Ogre::Real radius=0.001f, Ogre::Entity *type=NULL)
 
void deleteTrees (TBounds area, Ogre::Entity *type=NULL)
 
void setHeightFunction (Ogre::Real(*heightFunction)(Ogre::Real x, Ogre::Real z, void *userData), void *userData=NULL)
 
void setColorMap (const Ogre::String &mapFile, MapChannel channel=CHANNEL_COLOR)
 
void setColorMap (Ogre::TexturePtr map, MapChannel channel=CHANNEL_COLOR)
 
ColorMap * getColorMap ()
 
void setColorMapFilter (MapFilter filter)
 
void setMaximumScale (Ogre::Real maxScale)
 
Ogre::Real getMaximumScale () const
 
void setMinimumScale (Ogre::Real minScale)
 
Ogre::Real getMinimumScale () const
 
const TBounds & getBounds () const
 
void loadPage (PageInfo &page)
 
- Public Member Functions inherited from Forests::PageLoader
virtual void frameUpdate ()
 
virtual ~PageLoader ()
 

Additional Inherited Members

- Protected Member Functions inherited from Forests::PageLoader
void addEntity (Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale=Ogre::Vector3::UNIT_SCALE, const Ogre::ColourValue &color=Ogre::ColourValue::White)
 

Constructor & Destructor Documentation

◆ RandomTreeLoader()

Forests::RandomTreeLoader::RandomTreeLoader ( PagedGeometry *  geom,
const TBounds &  bounds 
)
inline

Definition at line 40 of file RandomTreeLoader.h.

◆ ~RandomTreeLoader()

Forests::RandomTreeLoader::~RandomTreeLoader ( )
inline

Definition at line 44 of file RandomTreeLoader.h.

Member Function Documentation

◆ loadPage()

void Forests::RandomTreeLoader::loadPage ( PageInfo &  page)
inlinevirtual

This should be overridden to load a specified region of entities.

Parameters
pageA PageInfo variable which includes boundary information and other useful values.

Override this function to load entities within the specified boundary. The boundary information is contained in the "page" parameter, along with other useful information as well (see the PageInfo documentation for more info about this).

Simply use the member function addEntity() to add all the entities you want. If you create your own objects inside this function, you are responsible for deleting it appropriately in unloadPage() or somewhere else. The PageInfo::userData member is useful here since you can point it to your data structures for later reference in unloadPage().

Warning
Do not ever add an entity outside of the given region, otherwise this may crash the program (depending on how the current page types handle this situation).
See also
PagedGeometry::addDetailLevel() for information about page types.

Implements Forests::PageLoader.

Definition at line 48 of file RandomTreeLoader.h.

◆ unloadPage()

void Forests::RandomTreeLoader::unloadPage ( PageInfo &  page)
inlinevirtual

This may be overridden (optional) to unload custom data associated with a page.

Parameters
pageA PageInfo variable which includes boundary information and other useful values.

During a PageLoader::loadPage() call, you are supposed to add entities by calling the addEntity() member function. In case you created anything else (particle systems, sound effects, etc.), this function gives you a chance to delete them along with the rest of the entities added with addEntity().

Note
Entities added with addEntity() will automatically be deleted after this function returns, so you don't need to worry about them.

In most cases you won't need to implement this function in your page loader at all, since addEntity() is usually all that is used.

Reimplemented from Forests::PageLoader.

Definition at line 91 of file RandomTreeLoader.h.


The documentation for this class was generated from the following file: