0.44.0
|
#include <iVoxelData.h>
Public Member Functions | |
iVoxelData ()=default | |
~iVoxelData () | |
void | initData (int64 width, int64 height, int64 depth) |
void | getCopy (iVoxelData &dst) |
void | clear () |
int64 | getWidth () const |
int64 | getDepth () const |
int64 | getHeight () const |
void | setVoxelDensity (iaVector3I pos, uint8 density) |
uint8 | getVoxelDensity (iaVector3I pos) |
void | setVoxelMaterial (iaVector3I pos, uint8 material) |
uint8 | getVoxelMaterial (iaVector3I pos) |
iaRLE< uint8, uint8 > & | getDensityPole (int64 xDir, int64 zDir) |
iaRLE< uint8, uint8 > & | getMaterialPole (int64 xDir, int64 zDir) |
void | setVoxelLine (iaVector3I pos1, iaVector3I pos2, uint8 density) |
void | getVoxelLine (iaVector3I pos1, iaVector3I pos2, std::vector< uint8 > &dst) |
void | setVoxelPole (iaVector3I pos, int64 height, uint8 density) |
bool | getIntersection (iaVector3I pos, iaVector3I dir, iaVector3I &returnPos, uint8 &returnValue) |
void | setClearValue (uint8 clearValue) |
uint8 | getClearValue () const |
bool | hasData () const |
Density is an 8 bit value where 0 means outside of the body and every value >0 lieas within the body. But a value of 1 actually means a density of zero too only that it will generate a body with zero volume. This way we can generate slopes down to a volume of zero or walls with a thickness of zero.
|
default |
does nothing
igor::iVoxelData::~iVoxelData | ( | ) |
release memory
void igor::iVoxelData::clear | ( | ) |
does same as initData but keeps the preset width height and depht
uint8 igor::iVoxelData::getClearValue | ( | ) | const |
void igor::iVoxelData::getCopy | ( | iVoxelData & | dst | ) |
int64 igor::iVoxelData::getDepth | ( | ) | const |
int64 igor::iVoxelData::getHeight | ( | ) | const |
bool igor::iVoxelData::getIntersection | ( | iaVector3I | pos, |
iaVector3I | dir, | ||
iaVector3I & | returnPos, | ||
uint8 & | returnValue | ||
) |
uint8 igor::iVoxelData::getVoxelDensity | ( | iaVector3I | pos | ) |
pos | the voxel to get the density from |
void igor::iVoxelData::getVoxelLine | ( | iaVector3I | pos1, |
iaVector3I | pos2, | ||
std::vector< uint8 > & | dst | ||
) |
reads a line of densities from the voxels
pos1 | the from position of the line | |
pos2 | the to position of the line | |
[out] | dst | the destination vector |
uint8 igor::iVoxelData::getVoxelMaterial | ( | iaVector3I | pos | ) |
int64 igor::iVoxelData::getWidth | ( | ) | const |
bool igor::iVoxelData::hasData | ( | ) | const |
specifies size of voxel data and allocates memory
width | width of voxel grid in voxels in x direction |
height | height of voxel grid in voxels in y direction |
depth | depth of voxel grid in voxels in z direction |
!!! ATTENTION this method must be called before any other method is called
void igor::iVoxelData::setClearValue | ( | uint8 | clearValue | ) |
void igor::iVoxelData::setVoxelDensity | ( | iaVector3I | pos, |
uint8 | density | ||
) |
sets density of specified voxel
pos | the voxel to change the density |
density | the new density (see explanation above) |
void igor::iVoxelData::setVoxelLine | ( | iaVector3I | pos1, |
iaVector3I | pos2, | ||
uint8 | density | ||
) |
sets a line of voxels to a target density
pos1 | the from pos |
pos2 | the to pos |
density | the density to set |
void igor::iVoxelData::setVoxelMaterial | ( | iaVector3I | pos, |
uint8 | material | ||
) |
void igor::iVoxelData::setVoxelPole | ( | iaVector3I | pos, |
int64 | height, | ||
uint8 | density | ||
) |
sets density of specified vertical voxel pole
pos | start pos of the pole in voxel coordinates |
height | height of the pole |
density | the new density (see explanation above) |