Allowing boundary values to be negative.

This commit is contained in:
David Williams 2013-01-02 21:52:44 +01:00
parent 8e5a09d0fc
commit 8fe824eb58
2 changed files with 10 additions and 10 deletions

View File

@ -133,21 +133,21 @@ namespace PolyVox
/// Tests whether the given point is contained in this Region. /// Tests whether the given point is contained in this Region.
bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const; bool containsPoint(const Vector3DFloat& pos, float boundary = 0.0f) const;
/// Tests whether the given point is contained in this Region. /// Tests whether the given point is contained in this Region.
bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary = 0) const; bool containsPoint(int32_t iX, int32_t iY, int32_t iZ, int8_t boundary = 0) const;
/// Tests whether the given point is contained in this Region. /// Tests whether the given point is contained in this Region.
bool containsPoint(const Vector3DInt32& pos, uint8_t boundary = 0) const; bool containsPoint(const Vector3DInt32& pos, int8_t boundary = 0) const;
/// Tests whether the given position is contained in the 'x' range of this Region. /// Tests whether the given position is contained in the 'x' range of this Region.
bool containsPointInX(float pos, float boundary = 0.0f) const; bool containsPointInX(float pos, float boundary = 0.0f) const;
/// Tests whether the given position is contained in the 'x' range of this Region. /// Tests whether the given position is contained in the 'x' range of this Region.
bool containsPointInX(int32_t pos, uint8_t boundary = 0) const; bool containsPointInX(int32_t pos, int8_t boundary = 0) const;
/// Tests whether the given position is contained in the 'y' range of this Region. /// Tests whether the given position is contained in the 'y' range of this Region.
bool containsPointInY(float pos, float boundary = 0.0f) const; bool containsPointInY(float pos, float boundary = 0.0f) const;
/// Tests whether the given position is contained in the 'y' range of this Region. /// Tests whether the given position is contained in the 'y' range of this Region.
bool containsPointInY(int32_t pos, uint8_t boundary = 0) const; bool containsPointInY(int32_t pos, int8_t boundary = 0) const;
/// Tests whether the given position is contained in the 'z' range of this Region. /// Tests whether the given position is contained in the 'z' range of this Region.
bool containsPointInZ(float pos, float boundary = 0.0f) const; bool containsPointInZ(float pos, float boundary = 0.0f) const;
/// Tests whether the given position is contained in the 'z' range of this Region. /// Tests whether the given position is contained in the 'z' range of this Region.
bool containsPointInZ(int32_t pos, uint8_t boundary = 0) const; bool containsPointInZ(int32_t pos, int8_t boundary = 0) const;
/// Enlarges the Region so that it contains the specified position. /// Enlarges the Region so that it contains the specified position.
void accumulate(int32_t iX, int32_t iY, int32_t iZ); void accumulate(int32_t iX, int32_t iY, int32_t iZ);

View File

@ -199,7 +199,7 @@ namespace PolyVox
* \param iZ The 'z' position of the point to test. * \param iZ The 'z' position of the point to test.
* \param boundary The desired boundary value. * \param boundary The desired boundary value.
*/ */
bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, uint8_t boundary) const bool Region::containsPoint(int32_t iX, int32_t iY, int32_t iZ, int8_t boundary) const
{ {
return (iX <= m_iUpperX - boundary) return (iX <= m_iUpperX - boundary)
&& (iY <= m_iUpperY - boundary) && (iY <= m_iUpperY - boundary)
@ -216,7 +216,7 @@ namespace PolyVox
* \param pos The position to test. * \param pos The position to test.
* \param boundary The desired boundary value. * \param boundary The desired boundary value.
*/ */
bool Region::containsPoint(const Vector3DInt32& pos, uint8_t boundary) const bool Region::containsPoint(const Vector3DInt32& pos, int8_t boundary) const
{ {
return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary); return containsPoint(pos.getX(), pos.getY(), pos.getZ(), boundary);
} }
@ -241,7 +241,7 @@ namespace PolyVox
* \param pos The position to test. * \param pos The position to test.
* \param boundary The desired boundary value. * \param boundary The desired boundary value.
*/ */
bool Region::containsPointInX(int32_t pos, uint8_t boundary) const bool Region::containsPointInX(int32_t pos, int8_t boundary) const
{ {
return (pos <= m_iUpperX - boundary) return (pos <= m_iUpperX - boundary)
&& (pos >= m_iLowerX + boundary); && (pos >= m_iLowerX + boundary);
@ -267,7 +267,7 @@ namespace PolyVox
* \param pos The position to test. * \param pos The position to test.
* \param boundary The desired boundary value. * \param boundary The desired boundary value.
*/ */
bool Region::containsPointInY(int32_t pos, uint8_t boundary) const bool Region::containsPointInY(int32_t pos, int8_t boundary) const
{ {
return (pos <= m_iUpperY - boundary) return (pos <= m_iUpperY - boundary)
&& (pos >= m_iLowerY + boundary); && (pos >= m_iLowerY + boundary);
@ -293,7 +293,7 @@ namespace PolyVox
* \param pos The position to test. * \param pos The position to test.
* \param boundary The desired boundary value. * \param boundary The desired boundary value.
*/ */
bool Region::containsPointInZ(int32_t pos, uint8_t boundary) const bool Region::containsPointInZ(int32_t pos, int8_t boundary) const
{ {
return (pos <= m_iUpperZ - boundary) return (pos <= m_iUpperZ - boundary)
&& (pos >= m_iLowerZ + boundary); && (pos >= m_iLowerZ + boundary);