Handles instanced voxel data. More...
#include <InstanceManager.h>
Public Member Functions | |
| CInstanceManager (Architecture::CArchitectureManager *architectureManager) | |
| int | loadClassData (char *name, char *filename) |
| Load data for one class. | |
| int | loadClassData (VoxelFarm::IInputStream *reader, char *name, char *filename) |
| Load data for one class from a resource stream. | |
| int | loadClassDataRaw (const char *name, const char *data) |
| Load data for one class out of the provided raw data. | |
| virtual void | getContourData (CellId cell, ContourVoxelData *data, bool &empty, void *threadContext) override |
| Returns voxel data for the specified cell (IVoxelLayer) More... | |
| virtual void | planJobs (Scene *scene) override |
| Processes a scene to get new entities from it. This is called by the scene creation loop. It adds master cells to the instance grid for their generation in worker threads. | |
| virtual void | runJobs () override |
| Processes pending generation requests. This is called by the contouring loop. Pending cells will be generated at this time. | |
| virtual void * | createThreadContext () override |
| The voxel layer can use this method to return a structure that will be unique for each calling thread. This allows to have lock-free work buffers assigned to each worker thread. | |
| virtual void | disposeThreadContext (void *threadContext) override |
| Destroys the specified thread context. | |
| virtual int | getStatsContourId () override |
| Returns the stats ID to be used for measuring performance of the getContourData() method. | |
| virtual int * | generateInstances (CellId cell) |
| Runs planting rules over one cell. | |
| virtual double | getMaskValue (double x, double y, double z) override |
| Retrieves a mask value based on whether there are instances in that coordinate. | |
Public Member Functions inherited from VoxelFarm::IVoxelLayer | |
| virtual int | getStatsPlanJobsId () |
| Returns the stats ID to be used for measuring performance of the planJobs() method. | |
| virtual int | getStatsRunJobsId () |
| Returns the stats ID to be used for measuring performance of the runJobs() method. | |
| virtual bool | isCacheable () |
| Returns true if the layer's output can be cached. Return true if the output for a cell will always be the same. | |
Protected Attributes | |
| Architecture::CArchitectureManager * | architectureManager |
| TVector< ClassData > | classes |
| TMap< CellId, TVector< int > > | instances |
| TMap< CellId, int * > | instanceMap |
| TVector< InstanceData > | instanceData |
| TMap< String, int > | classMap |
| TSet< CellId > | generatedCells |
| ExternalMutex::Mutex | lock |
| TSet< CellId > | pendingCells |
Handles instanced voxel data.
Definition at line 81 of file InstanceManager.h.
|
overridevirtual |
Returns voxel data for the specified cell (IVoxelLayer)
| cell | ID of the cell |
| data | A buffer where the voxel data will be copied. |
| empty | A flag notifying the entire cell is empty and could be discarded by the caller |
Implements VoxelFarm::IVoxelLayer.