Added basic dilation and erosion functions.
This commit is contained in:
parent
9671f19444
commit
cbddc9cba4
@ -121,6 +121,9 @@ namespace PolyVox
|
||||
void shiftUpperCorner(const Vector3DInt32& amount);
|
||||
//FIXME - Add dilate and erode functions?
|
||||
|
||||
void dilate(int32_t amount);
|
||||
void erode(int32_t amount);
|
||||
|
||||
|
||||
private:
|
||||
int32_t m_iLowerX;
|
||||
|
@ -306,4 +306,26 @@ namespace PolyVox
|
||||
m_iUpperY += amount.getY();
|
||||
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