8 #include "MaterialLibrary.h"
11 #include "Generator.h"
12 #include "FastQuadrics.h"
64 MaterialId* materials;
88 MaterialId* materials,
111 MaterialId* materials,
A node in the contouring octree. This octree is used to compress the polygonal output of the contouri...
Algebra::QEFMatrix qef
Quadratic Error collected for the cell.
Combines several voxel layers into the final dataset sent to the contouring phase.
Contains all classes and functions for the VoxelFarm engine.
Contains all materials available in the system.
Algebra::Vector p
A point inside the cell where the isosurface crosses.
bool homogeneus
Node is made of same material inside.
static const int MEDIUM_MAX
Number of different mediums in the world. Each medium may be subject to a different rendering logic...
int material
Material id for the node.
unsigned __int64 CellId
A 64bit integer that identifies a single world octree Cell.
double maxError
Maximum simplification error allowed for the node.
Stores the information for a Cell that has already been converted to a polygonal mesh.
Generation of voxel data and then meshes out if it can be time consuming. The engine allows multiple ...
const int CONTOUR_OCTREE_LEVELS
How many times the contouring octree can subdivide.
int contourCellDataLayerGroup(ContourThreadContext *tc, CMaterialLibrary *materialLibrary, CCellData *cellData, bool compress, LODStats stats)
Contours voxel data of each group of layers and stores the output in a polygonal mesh (CCellData) obj...
bool leaf
Indicates whether it is a end node in the octree.
StatTracker LODStats[LEVELS][STAT_NULL]
Used to track stats across all LOD.
bool contourCellDataMCA(ContourThreadContext *tc, CMaterialLibrary *materialLibrary, CCellData *cellData, CBillboardCache *billboardCache, CCellData::ThreadContext *cellDataThreadContext, bool compress, LODStats stats)
const int CONTOUR_OCTREE_SIZE
Number of voxels along one dimension in the contouring octree.
An interface for caching data.
A matrix for minimizing Quadratic Error functions.
virtual bool voxelCellData(CellId cell, ContourVoxelData *data, int layerGroup)=0
Cache a buffer of voxels. Return true if there are cached data for the cell.
unsigned int map
Links the node to another node in the octree. This is set when the octree is compressed.
void getCellChildrenNavigationMeshes(ICellDataCache *cellDataCache, CGenerator *generator, CellId cell, int childLevel, double featureSize, double maxError, bool computeMedium[CCellData::MEDIUM_MAX], CFastQuadrics *meshes[CCellData::MEDIUM_MAX], CMaterialLibrary *materialLibrary)
Get the simplified mesh for a cell using child cells.
virtual bool meshCellData(CellId cell, bool medium[CCellData::MEDIUM_MAX], CFastQuadrics *mesh[CCellData::MEDIUM_MAX])=0
Cache a mesh as a CFastQuadrics by each medium. Return true if there are any cached mesh for the cell...
unsigned int children[8]
Pointers to the eight children.
unsigned int index
Pointer to the vertex information.
bool processCellDataMCA(CMaterialLibrary *materialLibrary, CCellData *cellData, CBillboardCache *billboardCache, CCellData::ThreadContext *cellDataThreadContext, LODStats stats)
bool contourCellData(ContourThreadContext *tc, CMaterialLibrary *materialLibrary, CCellData *cellData, CBillboardCache *billboardCache, CCellData::ThreadContext *cellDataThreadContext, LODStats stats)
Contours voxel data and stores the output in a polygonal mesh (CCellData) object. ...
int count
Number of isosurface crossings.
An efficient mesh representation that features Quadratic Error function simplification using a Multip...
int contour(int level, ContourVoxelData *data, CMaterialLibrary *materialLibrary, OctreeNode *nodes, CCellData::CVert *points, int *pointIndex, int *quadIndex, int *quadType, bool *edgeSign, MaterialId *materials, int &lastPointId)
Performs contouring on the voxel data.
short targetLevel
Octree can collapse below this specified level.
Keeps an billboard cache entry for each cell that had its billboards and material instances generated...
bool boundary
Indicates whether the node is in the world cell boundary.