Fixed potential bug with negative voxel positions in large volume.
This commit is contained in:
parent
19a1f99723
commit
1f9264a9f8
@ -488,18 +488,22 @@ namespace PolyVox
|
|||||||
|
|
||||||
this->m_regValidRegion = regValidRegion;
|
this->m_regValidRegion = regValidRegion;
|
||||||
|
|
||||||
m_regValidRegionInBlocks.setLowerCorner(this->m_regValidRegion.getLowerCorner() / static_cast<int32_t>(uBlockSideLength));
|
//Compute the block side length
|
||||||
m_regValidRegionInBlocks.setUpperCorner(this->m_regValidRegion.getUpperCorner() / static_cast<int32_t>(uBlockSideLength));
|
m_uBlockSideLength = uBlockSideLength;
|
||||||
|
m_uBlockSideLengthPower = logBase2(m_uBlockSideLength);
|
||||||
|
|
||||||
|
m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uBlockSideLengthPower);
|
||||||
|
m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uBlockSideLengthPower);
|
||||||
|
m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uBlockSideLengthPower);
|
||||||
|
m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uBlockSideLengthPower);
|
||||||
|
m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower);
|
||||||
|
m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower);
|
||||||
|
|
||||||
setMaxNumberOfUncompressedBlocks(m_uMaxNumberOfUncompressedBlocks);
|
setMaxNumberOfUncompressedBlocks(m_uMaxNumberOfUncompressedBlocks);
|
||||||
|
|
||||||
//Clear the previous data
|
//Clear the previous data
|
||||||
m_pBlocks.clear();
|
m_pBlocks.clear();
|
||||||
|
|
||||||
//Compute the block side length
|
|
||||||
m_uBlockSideLength = uBlockSideLength;
|
|
||||||
m_uBlockSideLengthPower = logBase2(m_uBlockSideLength);
|
|
||||||
|
|
||||||
//Clear the previous data
|
//Clear the previous data
|
||||||
m_pBlocks.clear();
|
m_pBlocks.clear();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user