4 #include "VoxelLayer.h"
8 #include "FastQuadrics.h"
10 #include "PhysicsMaterials.h"
11 #include "PhysicsData.h"
12 #include "MaterialLibrary.h"
52 virtual MaterialId translateMaterial(
const double worldPos[3], MaterialId meshMaterial) = 0;
64 const double worldPos[3],
68 TSet<CellId>* changedCells
80 const double worldPos[3],
84 TSet<CellId>* changedCells,
89 const TMap<CellId, unsigned char*>* voxelCache = NULL,
90 const int hitMaterial = 0
100 int xsize,
int ysize,
int zsize,
104 const double worldPos[3],
106 TSet<CellId>* changedCells
116 int xsize,
int ysize,
int zsize,
120 const double worldPos[3],
122 TSet<CellId>* changedCells
128 ShortVoxel* voxelData,
134 const float meshOrigin[3],
136 const float meshRotation[3],
138 int xsize,
int ysize,
int zsize,
150 const double worldPos[3],
152 const int deletionLOD,
158 std::set<CellId>* changedCells
164 ShortVoxel* voxelData,
170 double kernelX,
double kernelY,
double kernelZ,
172 int kernelSizeX,
int kernelSizeY,
int kernelSizeZ,
188 double kernelX,
double kernelY,
double kernelZ,
190 int kernelSizeX,
int kernelSizeY,
int kernelSizeZ
200 int xsize,
int ysize,
int zsize
203 void voxelRLECompress(ShortVoxel* data,
int sizeX,
int sizeY,
int sizeZ, ShortVoxel* compIndex,
unsigned char* compData,
int& compSize);
void deleteMeshVoxels(CBlockData *blockData, IMeshStampSource *mesh, const double worldPos[3], const int deletionLOD, CMaterialLibrary *materialLibrary, Physics::CMassInfo *mass, std::set< CellId > *changedCells)
It deletes voxels associated with physics meshes.
Used for partially voxelization operations.
Contains all classes and functions for the VoxelFarm engine.
virtual int getFaceCount(int solid)=0
Returns the number of faces in a solid.
Contains all materials available in the system.
void voxelMeshMask(VoxelMaskData *voxelMask, IMeshStampSource *mesh, int xsize, int ysize, int zsize)
Returns a mask of voxels from a mesh.
A default implementation of IBlockData that also acts as a VoxelLayer.
It allows to access to the faces and materials of a list of solids.
void voxelizeMesh(ShortVoxel *voxelData, IMeshStampSource *mesh, int lod, const float meshOrigin[3], const float meshRotation[3], int xsize, int ysize, int zsize, Algebra::Vector &voxelMin, Algebra::Vector &voxelMax)
It voxelizes a mesh and returns a block of voxels.
void stampMesh(IBlockData *blockData, IMeshStampSource *mesh, IMeshStamMaterialSource *materials, const double worldPos[3], const Algebra::Matrix &transform, TSet< CellId > *changedCells)
It voxelizes a mesh and stamps it into a block layer.
A Matrix for 3D operations.
void voxelizeTriangles(ShortVoxel *voxelData, VoxelFarm::Algebra::Vector *vertexes, int vertexCount, double kernelX, double kernelY, double kernelZ, int kernelMargin, int kernelSizeX, int kernelSizeY, int kernelSizeZ, double &minDistance, double &maxDistance, bool &lostData)
It voxelizes a list of triangles.
void stampVoxelsQEF(IBlockData *blockData, ShortVoxel *source, int xsize, int ysize, int zsize, IMeshStamMaterialSource *materials, const double worldPos[3], TSet< CellId > *changedCells)
It stamps a block of voxels into a block layer and minimizes the error with the existing data...
void voxelizeSmoothMesh(StampSmoothData *voxelData, CFastQuadrics *mesh, double kernelX, double kernelY, double kernelZ, int kernelSizeX, int kernelSizeY, int kernelSizeZ)
Voxelizes partially a mesh based on precomputed data.
void stampVoxels(IBlockData *blockData, ShortVoxel *source, int xsize, int ysize, int zsize, IMeshStamMaterialSource *materials, const double worldPos[3], TSet< CellId > *changedCells)
It stamps a block of voxels into a block layer.
virtual MaterialId getSolidMaterial(int solid)=0
Returns the material of a solid.
virtual int getSolidCount()=0
Returns the number of solids.
virtual void getFace(int solid, int index, Algebra::Vector &v0, Algebra::Vector &v1, Algebra::Vector &v2)=0
Get the vertices of a face of a solid.
A structure for storing voxel information when we generate a mask from a mesh.
An efficient mesh representation that features Quadratic Error function simplification using a Multip...
uint32_t ShortVoxel
A compact 32 bit representation for a voxel.
void stampMeshQEF(IBlockData *blockData, IMeshStampSource *mesh, IMeshStamMaterialSource *materials, const double worldPos[3], const Algebra::Matrix &transform, TSet< CellId > *changedCells, Physics::CNoiseBrush *noise=NULL, Physics::CVoxelBuffer *nVoxBuffer=NULL, const TMap< CellId, unsigned char * > *voxelCache=NULL, const int hitMaterial=0)
It voxelizes a mesh and stamps it into a block layer and minimizes the error with the existing data...
It translates a given material depending of the position in the world.