Applied patch from ker such that int32_t's are now used instead of uint16_t's for addressing voxel positions.

This commit is contained in:
David Williams
2011-03-03 23:00:00 +00:00
parent 3c34d401fc
commit 4ef0cfb468
24 changed files with 278 additions and 251 deletions

View File

@ -31,28 +31,28 @@ namespace PolyVox
{
}
Region::Region(const Vector3DInt16& v3dLowerCorner, const Vector3DInt16& v3dUpperCorner)
Region::Region(const Vector3DInt32& v3dLowerCorner, const Vector3DInt32& v3dUpperCorner)
:m_v3dLowerCorner(v3dLowerCorner)
,m_v3dUpperCorner(v3dUpperCorner)
{
}
const Vector3DInt16& Region::getLowerCorner(void) const
const Vector3DInt32& Region::getLowerCorner(void) const
{
return m_v3dLowerCorner;
}
const Vector3DInt16& Region::getUpperCorner(void) const
const Vector3DInt32& Region::getUpperCorner(void) const
{
return m_v3dUpperCorner;
}
void Region::setLowerCorner(const Vector3DInt16& v3dLowerCorner)
void Region::setLowerCorner(const Vector3DInt32& v3dLowerCorner)
{
m_v3dLowerCorner = v3dLowerCorner;
}
void Region::setUpperCorner(const Vector3DInt16& v3dUpperCorner)
void Region::setUpperCorner(const Vector3DInt32& v3dUpperCorner)
{
m_v3dUpperCorner = v3dUpperCorner;
}
@ -67,7 +67,7 @@ namespace PolyVox
&& (pos.getZ() >= m_v3dLowerCorner.getZ() + boundary);
}
bool Region::containsPoint(const Vector3DInt16& pos, uint8_t boundary) const
bool Region::containsPoint(const Vector3DInt32& pos, uint8_t boundary) const
{
return (pos.getX() <= m_v3dUpperCorner.getX() - boundary)
&& (pos.getY() <= m_v3dUpperCorner.getY() - boundary)
@ -87,38 +87,38 @@ namespace PolyVox
m_v3dUpperCorner.setZ((std::min)(m_v3dUpperCorner.getZ(), other.m_v3dUpperCorner.getZ()));
}
int16_t Region::depth(void) const
int32_t Region::depth(void) const
{
return m_v3dUpperCorner.getZ() - m_v3dLowerCorner.getZ();
}
int16_t Region::height(void) const
int32_t Region::height(void) const
{
return m_v3dUpperCorner.getY() - m_v3dLowerCorner.getY();
}
void Region::shift(const Vector3DInt16& amount)
void Region::shift(const Vector3DInt32& amount)
{
m_v3dLowerCorner += amount;
m_v3dUpperCorner += amount;
}
void Region::shiftLowerCorner(const Vector3DInt16& amount)
void Region::shiftLowerCorner(const Vector3DInt32& amount)
{
m_v3dLowerCorner += amount;
}
void Region::shiftUpperCorner(const Vector3DInt16& amount)
void Region::shiftUpperCorner(const Vector3DInt32& amount)
{
m_v3dUpperCorner += amount;
}
Vector3DInt16 Region::dimensions(void)
Vector3DInt32 Region::dimensions(void)
{
return m_v3dUpperCorner - m_v3dLowerCorner;
}
int16_t Region::width(void) const
int32_t Region::width(void) const
{
return m_v3dUpperCorner.getX() - m_v3dLowerCorner.getX();
}