Page 1 of 1

a small bug in function: getCellDistanceFromBorders()???

Posted: Tue Mar 26, 2013 5:16 am
by njdxzjj
void DgmOctree::getCellDistanceFromBorders(const int* cellPos,
uchar level,
int* cellDists) const
{
const int* fillIndexes = m_fillIndexes+6*level;

int* _cellDists = cellDists;
*_cellDists++ = cellPos[0]-fillIndexes[0];
*_cellDists++ = fillIndexes[3]-cellPos[0];
*_cellDists++ = cellPos[1]-fillIndexes[1];
*_cellDists++ = fillIndexes[4]-cellPos[1];
*_cellDists++ = cellPos[2]-fillIndexes[2];
*_cellDists++ = fillIndexes[4]-cellPos[2]; //there is a small bug, and it should be : *_cellDists++ = fillIndexes[5]-cellPos[2];

Re: a small bug in function: getCellDistanceFromBorders()???

Posted: Tue Mar 26, 2013 7:26 am
by daniel
Nice one!

Luckily this version of the method is never called ;)