Renamed x(), y(), and z() to getX(), getY(), and getZ()

This commit is contained in:
David Williams
2008-05-26 19:49:21 +00:00
parent 2745d52dc5
commit d0ffdee870
9 changed files with 92 additions and 92 deletions

View File

@ -122,19 +122,19 @@ namespace PolyVox
boost::int32_t IndexedSurfacePatch::getIndexFor(const Vector3DFloat& pos)
{
assert(pos.x() >= 0.0f);
assert(pos.y() >= 0.0f);
assert(pos.z() >= 0.0f);
assert(pos.x() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.y() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.z() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.getX() >= 0.0f);
assert(pos.getY() >= 0.0f);
assert(pos.getZ() >= 0.0f);
assert(pos.getX() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.getY() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.getZ() <= POLYVOX_REGION_SIDE_LENGTH);
float xIntPart;
float xFracPart = std::modf(pos.x(), &xIntPart);
float xFracPart = std::modf(pos.getX(), &xIntPart);
float yIntPart;
float yFracPart = std::modf(pos.y(), &yIntPart);
float yFracPart = std::modf(pos.getY(), &yIntPart);
float zIntPart;
float zFracPart = std::modf(pos.z(), &zIntPart);
float zFracPart = std::modf(pos.getZ(), &zIntPart);
//Of all the fractional parts, two should be zero and one should have a value.
if(xFracPart > 0.000001f)
@ -154,21 +154,21 @@ namespace PolyVox
void IndexedSurfacePatch::setIndexFor(const Vector3DFloat& pos, boost::int32_t newIndex)
{
assert(pos.x() >= 0.0f);
assert(pos.y() >= 0.0f);
assert(pos.z() >= 0.0f);
assert(pos.x() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.y() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.z() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.getX() >= 0.0f);
assert(pos.getY() >= 0.0f);
assert(pos.getZ() >= 0.0f);
assert(pos.getX() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.getY() <= POLYVOX_REGION_SIDE_LENGTH);
assert(pos.getZ() <= POLYVOX_REGION_SIDE_LENGTH);
assert(newIndex < 10000);
float xIntPart;
float xFracPart = std::modf(pos.x(), &xIntPart);
float xFracPart = std::modf(pos.getX(), &xIntPart);
float yIntPart;
float yFracPart = std::modf(pos.y(), &yIntPart);
float yFracPart = std::modf(pos.getY(), &yIntPart);
float zIntPart;
float zFracPart = std::modf(pos.z(), &zIntPart);
float zFracPart = std::modf(pos.getZ(), &zIntPart);
//Of all the fractional parts, two should be zero and one should have a value.
if(xFracPart > 0.000001f)

View File

@ -36,31 +36,31 @@ namespace PolyVox
bool Region::containsPoint(const Vector3DFloat& pos, float boundary) const
{
return (pos.x() <= m_v3dUpperCorner.x() - boundary)
&& (pos.y() <= m_v3dUpperCorner.y() - boundary)
&& (pos.z() <= m_v3dUpperCorner.z() - boundary)
&& (pos.x() >= m_v3dLowerCorner.x() + boundary)
&& (pos.y() >= m_v3dLowerCorner.y() + boundary)
&& (pos.z() >= m_v3dLowerCorner.z() + boundary);
return (pos.getX() <= m_v3dUpperCorner.getX() - boundary)
&& (pos.getY() <= m_v3dUpperCorner.getY() - boundary)
&& (pos.getZ() <= m_v3dUpperCorner.getZ() - boundary)
&& (pos.getX() >= m_v3dLowerCorner.getX() + boundary)
&& (pos.getY() >= m_v3dLowerCorner.getY() + boundary)
&& (pos.getZ() >= m_v3dLowerCorner.getZ() + boundary);
}
bool Region::containsPoint(const Vector3DInt32& pos, boost::uint8_t boundary) const
{
return (pos.x() <= m_v3dUpperCorner.x() - boundary)
&& (pos.y() <= m_v3dUpperCorner.y() - boundary)
&& (pos.z() <= m_v3dUpperCorner.z() - boundary)
&& (pos.x() >= m_v3dLowerCorner.x() + boundary)
&& (pos.y() >= m_v3dLowerCorner.y() + boundary)
&& (pos.z() >= m_v3dLowerCorner.z() + boundary);
return (pos.getX() <= m_v3dUpperCorner.getX() - boundary)
&& (pos.getY() <= m_v3dUpperCorner.getY() - boundary)
&& (pos.getZ() <= m_v3dUpperCorner.getZ() - boundary)
&& (pos.getX() >= m_v3dLowerCorner.getX() + boundary)
&& (pos.getY() >= m_v3dLowerCorner.getY() + boundary)
&& (pos.getZ() >= m_v3dLowerCorner.getZ() + boundary);
}
void Region::cropTo(const Region& other)
{
m_v3dLowerCorner.setX((std::max)(m_v3dLowerCorner.x(), other.m_v3dLowerCorner.x()));
m_v3dLowerCorner.setY((std::max)(m_v3dLowerCorner.y(), other.m_v3dLowerCorner.y()));
m_v3dLowerCorner.setZ((std::max)(m_v3dLowerCorner.z(), other.m_v3dLowerCorner.z()));
m_v3dUpperCorner.setX((std::min)(m_v3dUpperCorner.x(), other.m_v3dUpperCorner.x()));
m_v3dUpperCorner.setY((std::min)(m_v3dUpperCorner.y(), other.m_v3dUpperCorner.y()));
m_v3dUpperCorner.setZ((std::min)(m_v3dUpperCorner.z(), other.m_v3dUpperCorner.z()));
m_v3dLowerCorner.setX((std::max)(m_v3dLowerCorner.getX(), other.m_v3dLowerCorner.getX()));
m_v3dLowerCorner.setY((std::max)(m_v3dLowerCorner.getY(), other.m_v3dLowerCorner.getY()));
m_v3dLowerCorner.setZ((std::max)(m_v3dLowerCorner.getZ(), other.m_v3dLowerCorner.getZ()));
m_v3dUpperCorner.setX((std::min)(m_v3dUpperCorner.getX(), other.m_v3dUpperCorner.getX()));
m_v3dUpperCorner.setY((std::min)(m_v3dUpperCorner.getY(), other.m_v3dUpperCorner.getY()));
m_v3dUpperCorner.setZ((std::min)(m_v3dUpperCorner.getZ(), other.m_v3dUpperCorner.getZ()));
}
}

View File

@ -60,7 +60,7 @@ namespace PolyVox
//////////////////////////////////////////////////////////////////////////
//Iterate over each cell in the region
for(volIter.setPosition(region.getLowerCorner().x(),region.getLowerCorner().y(), region.getLowerCorner().z());volIter.isValidForRegion();volIter.moveForwardInRegion())
for(volIter.setPosition(region.getLowerCorner().getX(),region.getLowerCorner().getY(), region.getLowerCorner().getZ());volIter.isValidForRegion();volIter.moveForwardInRegion())
{
//Current position
const uint16_t x = volIter.getPosX();
@ -345,9 +345,9 @@ namespace PolyVox
Vector3DFloat computeNormal(BlockVolume<uint8_t>* volumeData, const Vector3DFloat& position, NormalGenerationMethod normalGenerationMethod)
{
const float posX = position.x();
const float posY = position.y();
const float posZ = position.z();
const float posX = position.getX();
const float posY = position.getY();
const float posZ = position.getZ();
const uint16_t floorX = static_cast<uint16_t>(posX);
const uint16_t floorY = static_cast<uint16_t>(posY);
@ -460,7 +460,7 @@ namespace PolyVox
//////////////////////////////////////////////////////////////////////////
//Iterate over each cell in the region
for(volIter.setPosition(region.getLowerCorner().x(),region.getLowerCorner().y(), region.getLowerCorner().z());volIter.isValidForRegion();volIter.moveForwardInRegion())
for(volIter.setPosition(region.getLowerCorner().getX(),region.getLowerCorner().getY(), region.getLowerCorner().getZ());volIter.isValidForRegion();volIter.moveForwardInRegion())
{
//Current position
const uint16_t x = volIter.getPosX();
@ -747,9 +747,9 @@ namespace PolyVox
{
const float posX = position.x();
const float posY = position.y();
const float posZ = position.z();
const float posX = position.getX();
const float posY = position.getY();
const float posZ = position.getZ();
const uint16_t floorX = static_cast<uint16_t>(posX);
const uint16_t floorY = static_cast<uint16_t>(posY);

View File

@ -83,7 +83,7 @@ namespace PolyVox
std::string SurfaceVertex::tostring(void) const
{
std::stringstream ss;
ss << "SurfaceVertex: Position = (" << position.x() << "," << position.y() << "," << position.z() << "), Normal = " << normal;
ss << "SurfaceVertex: Position = (" << position.getX() << "," << position.getY() << "," << position.getZ() << "), Normal = " << normal;
return ss.str();
}
}

View File

@ -115,7 +115,7 @@ namespace PolyVox
uint8_t VolumeChangeTracker::getVoxelAt(const Vector3DUint16& pos)
{
return getVoxelAt(pos.x(), pos.y(), pos.z());
return getVoxelAt(pos.getX(), pos.getY(), pos.getZ());
}
uint8_t VolumeChangeTracker::getVoxelAt(uint16_t uX, uint16_t uY, uint16_t uZ)
@ -206,13 +206,13 @@ namespace PolyVox
throw std::logic_error("No region is locked. You must lock a region before you can unlock it.");
}
const uint16_t firstRegionX = m_regLastLocked.getLowerCorner().x() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t firstRegionY = m_regLastLocked.getLowerCorner().y() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t firstRegionZ = m_regLastLocked.getLowerCorner().z() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t firstRegionX = m_regLastLocked.getLowerCorner().getX() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t firstRegionY = m_regLastLocked.getLowerCorner().getY() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t firstRegionZ = m_regLastLocked.getLowerCorner().getZ() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t lastRegionX = m_regLastLocked.getUpperCorner().x() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t lastRegionY = m_regLastLocked.getUpperCorner().y() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t lastRegionZ = m_regLastLocked.getUpperCorner().z() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t lastRegionX = m_regLastLocked.getUpperCorner().getX() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t lastRegionY = m_regLastLocked.getUpperCorner().getY() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
const uint16_t lastRegionZ = m_regLastLocked.getUpperCorner().getZ() >> POLYVOX_REGION_SIDE_LENGTH_POWER;
for(uint16_t zCt = firstRegionZ; zCt <= lastRegionZ; zCt++)
{