![]() |
Rigs of Rods 2026.01
Soft-body Physics Simulation
|
A custom page type designed specifically for use with GrassLoader.
You can use this in your own project if you want, but remember that no optimizations are performed. The given entity is simply cloned and attached to a new scene node as quickly and simply as possible (this means there's no batching overhead as in BatchPage, but it also means potentially poor performance if you don't know what you're doing).
Definition at line 548 of file GrassLoader.h.
Inheritance diagram for Forests::GrassPage:Public Member Functions | |
| void | init (PagedGeometry *geom, const Ogre::Any &data) |
| ~GrassPage () | |
| void | addEntity (Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale, const Ogre::ColourValue &color) |
| void | removeEntities () |
| void | setFade (bool enabled, Ogre::Real visibleDist, Ogre::Real invisibleDist) |
| void | setVisible (bool visible) |
Public Member Functions inherited from Forests::GeometryPage | |
| virtual void | setRegion (Ogre::Real left, Ogre::Real top, Ogre::Real right, Ogre::Real bottom) |
| virtual void | build () |
| virtual void | update () |
| Ogre::Vector3 & | getCenterPoint () |
| bool | isVisible () |
| virtual const Ogre::AxisAlignedBox & | getBoundingBox () |
| virtual void | addEntityToBoundingBox (Ogre::Entity *ent, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, const Ogre::Vector3 &scale) |
| virtual void | clearBoundingBox () |
| virtual | ~GeometryPage () |
| GeometryPage () | |
Static Private Member Functions | |
| static Ogre::String | getUniqueID () |
Private Attributes | |
| Ogre::SceneManager * | sceneMgr |
| Ogre::SceneNode * | rootNode |
| std::list< Ogre::SceneNode * > | nodeList |
Static Private Attributes | |
| static unsigned long | GUID = 0 |
| Forests::GrassPage::~GrassPage | ( | ) |
Definition at line 1434 of file GrassLoader.cpp.
|
virtual |
Add an entity to the page, at the specified position, rotation, and scale.
| ent | The entity that is being added. Keep in mind that the same entity may be added multiple times. |
| position | The position where the entity must be placed. Under normal circumstances, this will never be outside of the bounds supplied to init(). The only exception is when a PageLoader tries to add an entity outside of the bounds it was given. |
| rotation | The rotation which should be applied to the entity. |
| scale | The scale which should be applied to the entity. |
| color | The desired color to apply to the whole entity |
Implements Forests::GeometryPage.
Definition at line 1439 of file GrassLoader.cpp.
|
inlinestaticprivate |
Definition at line 566 of file GrassLoader.h.
|
virtual |
Prepare a geometry page for use.
| geom | The PagedGeometry object that's creating this GeometryPage. |
| data | A single parameter of custom data (optional). |
This is called immediately after creating a new GeometryPage. It is never called more than once for a single instance of your geometry page.
The "data" parameter is set for all pages when PagedGeometry::addDetailLevel() is called. This parameter is optional and can be used for whatever you like if you need a constructor parameter of some kind. Be sure to document what kind of variable the user needs to supply and what it's purpose is in your GeometryPage implementation.
Implements Forests::GeometryPage.
Definition at line 1428 of file GrassLoader.cpp.
|
virtual |
Remove all geometry/entities from the page completely.
Make sure this completely reverses the effects of both build() and addEntity(). This is necessary, because after this is called, the entities will most likely be added again with addEntity() and build().
Do not leave any remains of the entities in memory after this function is called. One of the advantages of using paged geometry is that you can have near-infinite game worlds, which would normally exceed a computer's RAM capacity. This advantage would completely disappear if you did not clean up properly when the page manager calls this function.
Implements Forests::GeometryPage.
Definition at line 1449 of file GrassLoader.cpp.
|
inlinevirtual |
Sets fade behavior for this page.
| enabled | Whether or not to enable fading |
| visibleDist | The distance where geometry will be fully opaque (alpha 1) |
| invisibleDist | The distance where geometry will be invisible (alpha 0) |
This is called whenever a page needs fading enabled/disabled. The distance ranges given specify how the final alpha values should be calculated - geometry at visibleDist should have alpha values of 1, while geometry at invisibleDist should have alpha values of 0. Important: Distances must be calculated in the xz plane only - the y coordinate should be disregarded when calculating distance.
setFade() won't be called unless the user's computer supports vertex shaders.
Implements Forests::GeometryPage.
Definition at line 556 of file GrassLoader.h.
|
virtual |
Toggle the entire page's visibility.
| visible | Whether or not this page should be visible. |
Implements Forests::GeometryPage.
Definition at line 1471 of file GrassLoader.cpp.
|
staticprivate |
Definition at line 565 of file GrassLoader.h.
|
private |
Definition at line 563 of file GrassLoader.h.
|
private |
Definition at line 561 of file GrassLoader.h.
|
private |
Definition at line 560 of file GrassLoader.h.