13 #include "VoxelLayer.h"
14 #include "ArchitectureManager.h"
15 #include "ExternalMutex.h"
88 TVector<ClassData> classes;
89 TMap<CellId, TVector<int>> instances;
90 TMap<CellId, int*> instanceMap;
91 TVector<InstanceData> instanceData;
92 TMap<String, int> classMap;
93 TSet<CellId> generatedCells;
95 TSet<CellId> pendingCells;
97 void addPendingCell(
CellId cellId);
113 void* threadContext)
override;
117 virtual void runJobs()
override;
122 return STAT_INSTANCES;
130 virtual double getMaskValue(
double x,
double y,
double z)
override;
virtual void runJobs() override
Processes pending generation requests. This is called by the contouring loop. Pending cells will be g...
unsigned char * stream[MAX_INSTANCE_LOD]
Buffer containing compressed data.
const int MAX_INSTANCE_LOD
Maximum cell level for which instances will be generated.
enum VoxelFarm::InstanceMirror_T InstanceMirror
Defines a rule for scattering instances.
unsigned int * indices[MAX_INSTANCE_LOD]
Buffer containing indices to compressed streams.
short sizeX
Voxel data size along X axis.
Contains all classes and functions for the VoxelFarm engine.
InstanceRotation rotationAngle
specify the rotation angle
An interface for a 3D mask. A mask can be used to control the application of other features...
virtual void * createThreadContext() override
The voxel layer can use this method to return a structure that will be unique for each calling thread...
virtual int getStatsContourId() override
Returns the stats ID to be used for measuring performance of the getContourData() method...
virtual void disposeThreadContext(void *threadContext) override
Destroys the specified thread context.
Architecture system. It keeps a list of entities, their classes and the mesh instances they have prod...
short sizeZ
Voxel data size along Z axis.
int * generateInstances(CellId cell)
Runs planting rules over one cell.
unsigned __int64 CellId
A 64bit integer that identifies a single world octree Cell.
virtual double getMaskValue(double x, double y, double z) override
Retrieves a mask value based on whether there are instances in that coordinate.
Cells Scene
A Scene is a set of cells.
short originX
Offset to the center of the voxel data in the X axis.
An interface for a voxel layer. By implementing this interface, very different modules can contribute...
Handles instanced voxel data.
int x
world coordinates in voxels for the instance
int * materialMap
A list of material re-mappings for the instance.
short originZ
Offset to the center of the voxel data in the Z axis.
short sizeY
Voxel data size along Y axis.
Defines the world elevation at any XZ point. Contains a collection of biomes.
int * generateInstances(CellId cell)
Runs planting rules over one cell.
Information about one instance.
virtual int * generateInstances(CellId cell)
Runs planting rules over one cell.
int classId
Indentifier to the class for the instance.
virtual void planJobs(Scene *scene) override
Processes a scene to get new entities from it. This is called by the scene creation loop...
Handles instanced voxel data.
short originY
Offset to the center of the voxel data in the Y axis.
virtual void getContourData(CellId cell, ContourVoxelData *data, bool &empty, void *threadContext) override
Returns voxel data for the specified cell (IVoxelLayer)
Defines a voxel class that can be instanced many times over.
const int MASTER_GENERATION_LEVEL
Level at which the instance index will be kept.
Handles instanced voxel data.
InstanceMirror mirrorAxis
specify the mirror axis of the instance
int streamSize[MAX_INSTANCE_LOD]
Number of bytes in the compressed stream.
int loadClassDataRaw(const char *name, const char *data)
Load data for one class out of the provided raw data.
const int GENERATION_GRID_SIZE
Resolution of an instance index page.
int loadClassData(char *name, char *filename)
Load data for one class.