diff --git a/library/PolyVoxCore/include/PolyVoxCore/Region.h b/library/PolyVoxCore/include/PolyVoxCore/Region.h index fbb7fdb4..ae674a19 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Region.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Region.h @@ -162,13 +162,6 @@ namespace PolyVox /// Grows this region by the amounts specified. void grow(const Vector3DInt32& v3dAmount); - /// Shrinks this region by the amount specified. - void shrink(int32_t iAmount); - /// Shrinks this region by the amounts specified. - void shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); - /// Shrinks this region by the amounts specified. - void shrink(const Vector3DInt32& v3dAmount); - /// Tests whether all components of the upper corner are at least /// as great as the corresponding components of the lower corner. bool isValid(void) const; @@ -186,6 +179,13 @@ namespace PolyVox /// Moves the upper corner of the Region by the amount specified. void shiftUpperCorner(const Vector3DInt32& v3dAmount); + /// Shrinks this region by the amount specified. + void shrink(int32_t iAmount); + /// Shrinks this region by the amounts specified. + void shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ); + /// Shrinks this region by the amounts specified. + void shrink(const Vector3DInt32& v3dAmount); + private: int32_t m_iLowerX; int32_t m_iLowerY; diff --git a/library/PolyVoxCore/source/Region.cpp b/library/PolyVoxCore/source/Region.cpp index fa219b9e..a3aafc6b 100644 --- a/library/PolyVoxCore/source/Region.cpp +++ b/library/PolyVoxCore/source/Region.cpp @@ -330,50 +330,6 @@ namespace PolyVox grow(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); } - //////////////////////////////////////////////////////////////////////////////// - /// The same amount of shrinkage is applied in all directions. Negative shrinkage - /// is possible but you should prefer the grow() function for clarity. - /// \param iAmount The amount to shrink by. - //////////////////////////////////////////////////////////////////////////////// - void Region::shrink(int32_t iAmount) - { - m_iLowerX += iAmount; - m_iLowerY += iAmount; - m_iLowerZ += iAmount; - - m_iUpperX -= iAmount; - m_iUpperY -= iAmount; - m_iUpperZ -= iAmount; - } - - //////////////////////////////////////////////////////////////////////////////// - /// The amount can be specified seperatly for each direction. Negative shrinkage - /// is possible but you should prefer the grow() function for clarity. - /// \param iAmountX The amount to shrink by in 'x'. - /// \param iAmountY The amount to shrink by in 'y'. - /// \param iAmountZ The amount to shrink by in 'z'. - //////////////////////////////////////////////////////////////////////////////// - void Region::shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) - { - m_iLowerX += iAmountX; - m_iLowerY += iAmountY; - m_iLowerZ += iAmountZ; - - m_iUpperX -= iAmountX; - m_iUpperY -= iAmountY; - m_iUpperZ -= iAmountZ; - } - - //////////////////////////////////////////////////////////////////////////////// - /// The amount can be specified seperatly for each direction. Negative shrinkage - /// is possible but you should prefer the grow() function for clarity. - /// \param v3dAmount The amount to shrink by (one component for each direction). - //////////////////////////////////////////////////////////////////////////////// - void Region::shrink(const Vector3DInt32& v3dAmount) - { - shrink(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); - } - //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// bool Region::isValid(void) const @@ -440,4 +396,48 @@ namespace PolyVox { shiftUpperCorner(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); } + + //////////////////////////////////////////////////////////////////////////////// + /// The same amount of shrinkage is applied in all directions. Negative shrinkage + /// is possible but you should prefer the grow() function for clarity. + /// \param iAmount The amount to shrink by. + //////////////////////////////////////////////////////////////////////////////// + void Region::shrink(int32_t iAmount) + { + m_iLowerX += iAmount; + m_iLowerY += iAmount; + m_iLowerZ += iAmount; + + m_iUpperX -= iAmount; + m_iUpperY -= iAmount; + m_iUpperZ -= iAmount; + } + + //////////////////////////////////////////////////////////////////////////////// + /// The amount can be specified seperatly for each direction. Negative shrinkage + /// is possible but you should prefer the grow() function for clarity. + /// \param iAmountX The amount to shrink by in 'x'. + /// \param iAmountY The amount to shrink by in 'y'. + /// \param iAmountZ The amount to shrink by in 'z'. + //////////////////////////////////////////////////////////////////////////////// + void Region::shrink(int32_t iAmountX, int32_t iAmountY, int32_t iAmountZ) + { + m_iLowerX += iAmountX; + m_iLowerY += iAmountY; + m_iLowerZ += iAmountZ; + + m_iUpperX -= iAmountX; + m_iUpperY -= iAmountY; + m_iUpperZ -= iAmountZ; + } + + //////////////////////////////////////////////////////////////////////////////// + /// The amount can be specified seperatly for each direction. Negative shrinkage + /// is possible but you should prefer the grow() function for clarity. + /// \param v3dAmount The amount to shrink by (one component for each direction). + //////////////////////////////////////////////////////////////////////////////// + void Region::shrink(const Vector3DInt32& v3dAmount) + { + shrink(v3dAmount.getX(), v3dAmount.getY(), v3dAmount.getZ()); + } }