Commits

David Williams committed efb6d12

Eliminated dome calls to getVoxelAt.

  • Participants
  • Parent commits 45af7a4
  • Branches develop, feature/dualcontouring 1
    1. feature/extractor-optimizations

Comments (0)

Files changed (2)

tests/TestAStarPathfinder.cpp

 		return false;
 	}
 
-	typename VolumeType::VoxelType voxel = volData->getVoxelAt(v3dPos);
+	typename VolumeType::VoxelType voxel = volData->getVoxel<WrapModes::None>(v3dPos);
 	if(voxel != 0)
 	{
 		return false;

tests/TestVolumeSubclass.cpp

 			{
 				return mVolumeData[uXPos][uYPos][uZPos];
 			}
+		default:
+			{
+				// Should never happen
+				POLYVOX_ASSERT(false, "Invalid wrap mode");
+				return VoxelType();
+			}
 		}
 	}
 
 		return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder);
 	}
 
-	/// Gets the value used for voxels which are outside the volume
-	VoxelType getBorderValue(void) const { return 0; }
-	/// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates
-	VoxelType getVoxelAt(int32_t uXPos, int32_t uYPos, int32_t uZPos) const
-	{
-		if(this->m_regValidRegion.containsPoint(Vector3DInt32(uXPos, uYPos, uZPos)))
-		{
-			return mVolumeData[uXPos][uYPos][uZPos];
-		}
-		else
-		{
-			return getBorderValue();
-		}
-	}
-	/// Gets a voxel at the position given by a 3D vector
-	VoxelType getVoxelAt(const Vector3DInt32& v3dPos) const { return getVoxelAt(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ()); }
-
 	/// Sets the value used for voxels which are outside the volume
 	void setBorderValue(const VoxelType& tBorder) { }
 	/// Sets the voxel at the position given by <tt>x,y,z</tt> coordinates