The renderer class handles the correct rendering of a lod. Including renderdistance and enabling the submeshes for losing the cracks (transvoxel results). Takes the results and updates from the simple::surface and saves them into an octree. Casts signals on when to update an LOD. More...
#include <renderer.hpp>
Public Types | |
| typedef configType | t_config |
|
typedef t_config::t_renderer::t_tile | t_tile |
| typedef sharedPointer< t_tile > | t_tilePtr |
| typedef base< t_tile > | t_base |
| typedef t_base::t_tileId | t_tileId |
|
typedef sharedPointer < sync::identifier > | t_cameraPtr |
|
typedef sync::sender< t_tileId, t_cameraPtr > | t_sync |
|
typedef hashMap< vector3int32, t_tilePtr > | t_tileMap |
| typedef t_config::t_surface::t_tile | t_tileSurface |
|
typedef sharedPointer < t_tileSurface > | t_tileDataPtr |
|
typedef std::function< bool(vector3, axisAlignedBox)> | t_octreeSearchCallback |
|
typedef t_config::t_surface::t_simple | t_rendererSurface |
Public Types inherited from blub::procedural::voxel::simple::base< configType::t_renderer::t_tile > | |
|
typedef configType::t_renderer::t_tile | t_tile |
| typedef sharedPointer< t_tile > | t_tilePtr |
| typedef base< t_tile > | t_thisClass |
| typedef vector3int32 | t_tileId |
|
typedef hashMap< t_tileId, t_tilePtr > | t_tilesGotChangedMap |
| typedef std::function< t_tilePtr()> | t_createTileCallback |
| typedef blub::signal< void()> | t_sigEditDone |
Public Member Functions | |
| renderer (blub::async::dispatcher &worker, t_rendererSurface *tiles, const int32 &lod, const real &lodCutDistNear, const real &lodCutDistFar) | |
| renderer constructor. More... | |
| ~renderer () | |
| ~renderer destructor. | |
| void | addCamera (t_cameraPtr toAdd, const blub::vector3 &position) |
| addCamera adds an camera. More... | |
| void | updateCamera (t_cameraPtr toUpdate, const blub::vector3 &position) |
| updateCamera updates the position of a camera you have to add before by using addCamera() More... | |
| void | removeCamera (t_cameraPtr toRemove) |
| removeCamera removes a camera. More... | |
| const t_tileMap & | getTileMap () const |
| getTileMap Returns all surface-tiles holded by this class. Read-lock class before. More... | |
Public Member Functions inherited from blub::procedural::voxel::simple::base< configType::t_renderer::t_tile > | |
| base (blub::async::dispatcher &worker) | |
| base constructor More... | |
| ~base () | |
| ~base destructor | |
| void | lockForEdit () |
| lockForEdit locks the class for editing/writing it. Call unlockForEdit() after work done. Method executes locks by the dispatcher master. More... | |
| void | unlockForEdit () |
| unlockForEdit unlocks edit/write-lock and calls signalEditDone() . Method executes unlock by the dispatcher master. More... | |
| void | lockForRead () |
| lockForRead locks the class for reading. | |
| void | unlockRead () |
| unlockRead unlocks the class after reading. | |
| const t_tilesGotChangedMap & | getTilesThatGotEdited () const |
| getTilesThatGotEdited returns a list of tiles which changed since the last call lockForEdit() / lockForEditMaster() More... | |
| void | setCreateTileCallback (const t_createTileCallback &callback) |
| setCreateTileCallback sets a callback for creating tiles. Use this method if you want to create custom tiles. More... | |
| blub::async::strand & | getMaster () |
| getMaster returns the master dispatcher. The master synchronises jobs for the worker-thread and writes to class member. The master calls all methods which end with *Master. More... | |
| t_sigEditDone * | signalEditDone () |
| signalEditDone gets called after unlockForEdit() got called. More... | |
Protected Member Functions | |
| void | editDone () |
| editDone gets called when simple::surface changed. Read-locks surface. | |
| void | editDoneMaster () |
| editDoneMaster gets called when simple::surface changed. More... | |
| void | tileGotSetMaster (const t_tileId &id, const t_tileDataPtr toSet) |
| tileGotSetMaster sets the surface tiles to the octree. More... | |
| void | tileGotRemovedMaster (const t_tileId &id) |
| tileGotRemovedMaster removes tile from octree. More... | |
| bool | isInSyncRangeReceiver (const typename t_sync::t_receiver receiver, const vector3 &posOfReceiverLeafCenter, const typename t_sync::t_syncTree::t_nodePtr &octreeNode) |
| bool | isInSyncRangeSync (const typename t_sync::t_sync sync, const vector3 &posOfSyncLeafCenter, const typename t_sync::t_receiverTree::t_nodePtr &octreeNode) |
| void | addSyncReceiver (const typename t_sync::t_receiver receiver, const typename t_sync::t_sync sync) |
| addSyncReceiver gets called by octree if a tile should be visible. More... | |
| void | removeSyncReceiver (const typename t_sync::t_receiver receiver, const typename t_sync::t_sync sync) |
| removeSyncReceiver gets called by octree if a tile shouldn't be visible. More... | |
| void | updateLod (const t_tileId &id, t_tilePtr toUpdate) |
| updateLod checks if a neighbour of the tile has a different lod. If so it enables the by the transvoxel calculated submeshes, used to close the cracks. More... | |
| int32 | isInRange (const vector3 &posLeafCenter, const axisAlignedBox &octreeNode) |
| isInRange checks the distance of a tile to the camera. More... | |
| void | updateCameraMaster (t_cameraPtr toUpdate, const blub::vector3 &position) |
Protected Member Functions inherited from blub::procedural::voxel::simple::base< configType::t_renderer::t_tile > | |
| void | addToChangeList (const t_tileId &id, t_tilePtr toAdd) |
| addToChangeList adds a tile to the change-list. More... | |
| virtual bool | tryLockForEditMaster () |
| tryLockForEditMaster tries to lock for write. Call by master dispatcher. More... | |
| virtual void | lockForEditMaster () |
| lockForEditMaster locks for write, or waits until possible. Call by master dispatcher. | |
| virtual void | unlockForEditMaster () |
| unlockForEditMaster unlocks write. Call by master dispatcher. | |
| virtual t_tilePtr | createTile () const |
| createTile creates a new Tile. Uses callback set by setCreateTileCallback() More... | |
Additional Inherited Members | |
Protected Attributes inherited from blub::procedural::voxel::simple::base< configType::t_renderer::t_tile > | |
| blub::async::strand | m_master |
| m_master The master synchronises jobs for the worker-thread and writes to class member. The master calls all methods which end with *Master. | |
| blub::async::dispatcher & | m_worker |
| m_worker use it to dispatch heavy work. Don't write to class member with it. Do not use any locks. Use m_master for such tasks. | |
| t_tilesGotChangedMap | m_tilesThatGotEdited |
| t_createTileCallback | m_createTileCallback |
| async::mutexReadWrite | m_classLocker |
| t_sigEditDone | m_sigEditDone |
The renderer class handles the correct rendering of a lod. Including renderdistance and enabling the submeshes for losing the cracks (transvoxel results). Takes the results and updates from the simple::surface and saves them into an octree. Casts signals on when to update an LOD.
|
inline |
renderer constructor.
| worker | May get called by several threads. |
| tiles | Must not be nullptr. |
| lod | Level of detail index. Zero is the detail with highest resolution, one has half resolution and so on. |
| lodCutDistNear | Defines distance when a tile when it is too near. Will get disabled if tile is nearer lodCutDistNear. |
| lodCutDistFar | Defines distance when a tile when it is too far. Will get disabled if tile is farer away than lodCutDistFar. |
|
inline |
addCamera adds an camera.
| toAdd | Must not be nullptr |
| position | The initial position of the camera. |
|
inlineprotected |
addSyncReceiver gets called by octree if a tile should be visible.
| receiver | Camera |
| sync | Tile |
|
inlineprotected |
editDoneMaster gets called when simple::surface changed.
|
inline |
getTileMap Returns all surface-tiles holded by this class. Read-lock class before.
|
inlineprotected |
isInRange checks the distance of a tile to the camera.
| posLeafCenter | camera position. |
| octreeNode | axisAlignedBox of the surface-tile. |
|
inlineprotected |
|
inlineprotected |
|
inline |
removeCamera removes a camera.
| toRemove | Must not be nullptr. |
|
inlineprotected |
removeSyncReceiver gets called by octree if a tile shouldn't be visible.
| receiver | Camera |
| sync | Tile |
|
inlineprotected |
tileGotRemovedMaster removes tile from octree.
| id | TileId |
|
inlineprotected |
tileGotSetMaster sets the surface tiles to the octree.
| id | TileId |
| toSet | The Surface-tile to work on. |
|
inline |
updateCamera updates the position of a camera you have to add before by using addCamera()
| toUpdate | The camera, must not be nullptr. |
| position | The new position. |
|
inlineprotected |
|
inlineprotected |
updateLod checks if a neighbour of the tile has a different lod. If so it enables the by the transvoxel calculated submeshes, used to close the cracks.
| id | TileId |
| toUpdate | Surface-tile to work on. |
1.8.8