The OgreTile class converts the resulting vertices and indices of the voxel-terrain to the Ogre Hardwarebuffer. The class handles setVisible() when a tile gets cutted because it's too near or too far or a cracks has to get closed. The results of the transvoxel-algorithm for closing the cracks between the lod-tiles get set to submeshes. Every tile contains a Ogre::Mesh, a Ogre::Entity and a Ogre::SceneNode. For more information on how to use ogre3d see http://www.ogre3d.org/docs/manual/ and http://www.ogre3d.org/docs/api/1.9/ .
More...
#include <OgreTile.hpp>
|
virtual | ~OgreTile () |
| ~OgreTile desctructor. Calls the static method destroyAllGraphic() to ensure Ogre instances get deleted by the right thread. The graphicDispatcher set by create() must stay valid until after ogre3d shutdown.
|
|
void | setTileData (typename t_base::t_tileDataPtr convertToRenderAble, const blub::axisAlignedBox &aabb) |
|
void | setVisible (const bool &vis) override |
| setVisible sets if a tile should get rendered. All lod-submeshes must not be rendered either. More...
|
|
void | setVisibleLod (const blub::uint16 &indLod, const bool &vis) override |
|
| ~renderer () |
| ~renderer destructor
|
|
void | setTileData (t_tileDataPtr convertToRenderAble, const axisAlignedBox &aabb) |
| Implement this method and cast the data to your graphic engine. More...
|
|
virtual void | setVisibleLod (const uint16 &indLod, const bool &vis) |
| setVisibleLod sets if one of the 6 crack closing submeshes (for lod) should get rendered. More...
|
|
const bool & | getVisible () const |
| getVisible returns if a tile should get rendered. More...
|
|
const bool & | getVisibleLod (const uint16 &indLod) |
| getVisibleLod returns if a crack-closing lod-tile should get rendered. More...
|
|
t_thisPtrConst | getSharedThisPtr () const |
|
t_thisPtr | getSharedThisPtr () |
|
|
| OgreTile (Ogre::SceneManager *sc, Ogre::String materialName, blub::async::dispatcher &graphicDispatcher) |
| OgreTile constrcutor. More...
|
|
void | initialise () |
| initialise calls createMeshGraphic() on graphic thread. Not called by constructor because getSharedThisPtr() isn't yet available.
|
|
void | createMeshGraphic () |
| createMeshGraphic allocates and initialises an Ogre::Mesh where the vertices and indices will get saved to later.
|
|
void | setTileDataGraphic (blub::sharedPointer< t_voxelSurfaceTile > convertToRenderAble, const blub::axisAlignedBox &aabb) |
| setTileDataGraphic convertes a vector of vertices and indices to ogres hardware buffer. More...
|
|
void | setVisibleGraphic (const bool &vis) |
| setVisibleGraphic sets the whole tile to visible or invisible. Gets called when tile cutted because too near or too far away. More...
|
|
void | setVisibleLodGraphic (const blub::uint16 &indLod, const bool &vis) |
| setVisibleLodGraphic sets a subentity-visibility. Gets called if the neighbour tile has a different LOD. To close the occuring cracks this method gets called. More...
|
|
void | addCustomVertexInformation (Ogre::VertexBufferBinding *binding, const t_vertices &vertices) |
|
void | addCustomVertexDeclaration (Ogre::VertexDeclaration *decl) |
|
constPointer | getSharedThisPtr () const |
|
pointer | getSharedThisPtr () |
|
| renderer () |
| renderer constructor.
|
|
| base () |
| base constrcutor.
|
|
|
static void | destroyAllGraphic (Ogre::SceneManager *scene, Ogre::MeshPtr mesh_, Ogre::Entity *entity_, Ogre::SceneNode *node_) |
| destroyAllGraphic gets called by destructor - ensures that ogre3d classes get destroyed by the right thread. More...
|
|
template<typename configType = blub::procedural::voxel::config>
class OgreTile< configType >
The OgreTile class converts the resulting vertices and indices of the voxel-terrain to the Ogre Hardwarebuffer. The class handles setVisible() when a tile gets cutted because it's too near or too far or a cracks has to get closed. The results of the transvoxel-algorithm for closing the cracks between the lod-tiles get set to submeshes. Every tile contains a Ogre::Mesh, a Ogre::Entity and a Ogre::SceneNode. For more information on how to use ogre3d see http://www.ogre3d.org/docs/manual/ and http://www.ogre3d.org/docs/api/1.9/ .
- Examples:
- customVertexInformation.cpp, mesh.cpp, noise.cpp, and primitives.cpp.
template<typename configType >
template<typename configType >
create creates an instance and calls initialise().
- Parameters
-
sc | The ogre scene. Must not be nullptr; |
materialName | The ogre material-name. |
graphicDispatcher | Only the thread that initialised the Ogre::Root may call Ogre methods. The graphicDispatcher must get called on every frame by the ogre thread. Methods that end with Graphic have to get called by this dispatcher. |
- Returns
- returns an instance. Never nullptr.
template<typename configType >
void OgreTile< configType >::destroyAllGraphic |
( |
Ogre::SceneManager * |
scene, |
|
|
Ogre::MeshPtr |
mesh_, |
|
|
Ogre::Entity * |
entity_, |
|
|
Ogre::SceneNode * |
node_ |
|
) |
| |
|
staticprotected |
destroyAllGraphic gets called by destructor - ensures that ogre3d classes get destroyed by the right thread.
- Parameters
-
scene | Must not be nullptr. |
mesh_ | Must not be nullptr. |
entity_ | Must not be nullptr. |
node_ | Must not be nullptr. |
template<typename configType >
setTileDataGraphic convertes a vector of vertices and indices to ogres hardware buffer.
- Parameters
-
convertToRenderAble | To convert. |
aabb | Used for the meshes aabb and the center gets used as the position for the Ogre::SceneNode. |
template<typename configType >
void OgreTile< configType >::setVisible |
( |
const bool & |
vis | ) |
|
|
overridevirtual |
template<typename configType >
void OgreTile< configType >::setVisibleGraphic |
( |
const bool & |
vis | ) |
|
|
protected |
setVisibleGraphic sets the whole tile to visible or invisible. Gets called when tile cutted because too near or too far away.
- Parameters
-
template<typename configType >
void OgreTile< configType >::setVisibleLodGraphic |
( |
const blub::uint16 & |
indLod, |
|
|
const bool & |
vis |
|
) |
| |
|
protected |
setVisibleLodGraphic sets a subentity-visibility. Gets called if the neighbour tile has a different LOD. To close the occuring cracks this method gets called.
- Parameters
-
The documentation for this class was generated from the following file:
- /home/mlanner/Development/cpp/projects/voxelTerrain/voxelTerrain/examples/voxelterrain/source/OgreTile.hpp