Added basic dilation and erosion functions.
This commit is contained in:
parent
9671f19444
commit
cbddc9cba4
@ -120,6 +120,9 @@ namespace PolyVox
|
|||||||
void shiftLowerCorner(const Vector3DInt32& amount);
|
void shiftLowerCorner(const Vector3DInt32& amount);
|
||||||
void shiftUpperCorner(const Vector3DInt32& amount);
|
void shiftUpperCorner(const Vector3DInt32& amount);
|
||||||
//FIXME - Add dilate and erode functions?
|
//FIXME - Add dilate and erode functions?
|
||||||
|
|
||||||
|
void dilate(int32_t amount);
|
||||||
|
void erode(int32_t amount);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -306,4 +306,26 @@ namespace PolyVox
|
|||||||
m_iUpperY += amount.getY();
|
m_iUpperY += amount.getY();
|
||||||
m_iUpperZ += amount.getZ();
|
m_iUpperZ += amount.getZ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Region::dilate(int32_t amount)
|
||||||
|
{
|
||||||
|
m_iLowerX -= amount;
|
||||||
|
m_iLowerY -= amount;
|
||||||
|
m_iLowerZ -= amount;
|
||||||
|
|
||||||
|
m_iUpperX += amount;
|
||||||
|
m_iUpperY += amount;
|
||||||
|
m_iUpperZ += amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Region::erode(int32_t amount)
|
||||||
|
{
|
||||||
|
m_iLowerX += amount;
|
||||||
|
m_iLowerY += amount;
|
||||||
|
m_iLowerZ += amount;
|
||||||
|
|
||||||
|
m_iUpperX -= amount;
|
||||||
|
m_iUpperY -= amount;
|
||||||
|
m_iUpperZ -= amount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user