Commits

David Williams  committed 3249562

Removing more calls to getVoxelAt()...

  • Participants
  • Parent commits efb6d12
  • Branches develop, feature/dualcontouring

Comments (0)

Files changed (3)

File examples/SmoothLOD/main.cpp

 				if(fDistToCenter <= fRadius)
 				{
 					//Our new density value
-					//uint8_t uDensity = Density8::getmaxDensity()();
 					uint8_t uDensity = std::numeric_limits<uint8_t>::max();
 
-					//Get the old voxel
-					//uint8_t voxel = volData.getVoxelAt(x,y,z);
-
-					//Modify the density
-					//voxel.setDensity(uDensity);
-
 					//Wrte the voxel value into the volume	
 					volData.setVoxelAt(x, y, z, uDensity);
 				}

File library/PolyVoxCore/include/PolyVoxCore/ConstVolumeProxy.h

 		{
 			// PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual.
 			POLYVOX_ASSERT(m_regValid.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)), "Position is outside valid region");
-			return m_pVolume.getVoxelAt(uXPos, uYPos, uZPos);
+			return m_pVolume.getVoxel<WrapModes::DontCheck>(uXPos, uYPos, uZPos);
 		}
 
 		VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const
 		{
 			// PolyVox does not throw an exception when a voxel is out of range. Please see 'Error Handling' in the User Manual.
 			POLYVOX_ASSERT(m_regValid.containsPoint(v3dPos), "Position is outside valid region");
-			return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ());
+			return getVoxel<WrapModes::DontCheck>(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ());
 		}
 
 		void setVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tValue) const

File library/PolyVoxCore/include/PolyVoxCore/GradientEstimators.inl

 		const int32_t z = volIter.getPosition().getZ();
 
 		//FIXME - bitwise way of doing this?
-		typename VolumeType::VoxelType voxel1nx = volIter.getVoxelAt(x-2, y  ,z  ) > 0 ? 1: 0;
-		typename VolumeType::VoxelType voxel1px = volIter.getVoxelAt(x-2, y  ,z  ) > 0 ? 1: 0;
+		typename VolumeType::VoxelType voxel1nx = volIter.getVoxel(x-2, y  ,z  ) > 0 ? 1: 0;
+		typename VolumeType::VoxelType voxel1px = volIter.getVoxel(x-2, y  ,z  ) > 0 ? 1: 0;
 
-		typename VolumeType::VoxelType voxel1ny = volIter.getVoxelAt(x  , y-2,z  ) > 0 ? 1: 0;
-		typename VolumeType::VoxelType voxel1py = volIter.getVoxelAt(x  , y-2,z  ) > 0 ? 1: 0;
+		typename VolumeType::VoxelType voxel1ny = volIter.getVoxel(x  , y-2,z  ) > 0 ? 1: 0;
+		typename VolumeType::VoxelType voxel1py = volIter.getVoxel(x  , y-2,z  ) > 0 ? 1: 0;
 
-		typename VolumeType::VoxelType voxel1nz = volIter.getVoxelAt(x  , y  ,z-2) > 0 ? 1: 0;
-		typename VolumeType::VoxelType voxel1pz = volIter.getVoxelAt(x  , y  ,z-2) > 0 ? 1: 0;
+		typename VolumeType::VoxelType voxel1nz = volIter.getVoxel(x  , y  ,z-2) > 0 ? 1: 0;
+		typename VolumeType::VoxelType voxel1pz = volIter.getVoxel(x  , y  ,z-2) > 0 ? 1: 0;
 
 		return Vector3DFloat
 		(