Removed redundant hasMaterial and hasDensity traits.
Changed AStar default validator.
This commit is contained in:
		| @@ -37,27 +37,6 @@ namespace PolyVox | ||||
| 			return false; | ||||
| 		} | ||||
|  | ||||
| 		if(VoxelTypeTraits<VoxelType>::hasDensity()) | ||||
| 		{ | ||||
| 			//and if their density is above the threshold. | ||||
| 			VoxelType voxel = volData->getVoxelAt(v3dPos); | ||||
| 			typename VoxelType::DensityType tThreshold = (VoxelTypeTraits<VoxelType>::minDensity() + VoxelTypeTraits<VoxelType>::maxDensity()) / 2; | ||||
| 			if(voxel.getDensity() >= tThreshold) | ||||
| 			{ | ||||
| 				return false; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if(VoxelTypeTraits<VoxelType>::hasMaterial()) | ||||
| 		{ | ||||
| 			//and if their material is not zero. | ||||
| 			VoxelType voxel = volData->getVoxelAt(v3dPos); | ||||
| 			if(voxel.getMaterial() != 0) | ||||
| 			{ | ||||
| 				return false; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		return true; | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -99,10 +99,6 @@ namespace PolyVox | ||||
| 	public: | ||||
| 		typedef uint8_t DensityType; | ||||
| 		typedef uint8_t MaterialType; | ||||
| 		static const bool HasDensity = true; | ||||
| 		static const bool HasMaterial = false; | ||||
| 		static bool hasDensity() { return true; } | ||||
| 		static bool hasMaterial() { return false; } | ||||
| 		static Density8::DensityType minDensity() { return std::numeric_limits<Density8::DensityType>::min(); } | ||||
| 		static Density8::DensityType maxDensity() { return std::numeric_limits<Density8::DensityType>::max(); } | ||||
| 	}; | ||||
|   | ||||
| @@ -109,10 +109,6 @@ namespace PolyVox | ||||
| 	public: | ||||
| 		typedef uint8_t DensityType; | ||||
| 		typedef uint8_t MaterialType; | ||||
| 		static const bool HasDensity = false; | ||||
| 		static const bool HasMaterial = true; | ||||
| 		static bool hasDensity() { return false; } | ||||
| 		static bool hasMaterial() { return true; } | ||||
| 		static int minDensity() { assert(false); return 0; } | ||||
| 		static int maxDensity() { assert(false); return 0; } | ||||
| 	}; | ||||
| @@ -122,10 +118,6 @@ namespace PolyVox | ||||
| 	{ | ||||
| 	public: | ||||
| 		typedef uint8_t DensityType; | ||||
| 		static const bool HasDensity = false; | ||||
| 		static const bool HasMaterial = true; | ||||
| 		static bool hasDensity() { return false; } | ||||
| 		static bool hasMaterial() { return true; } | ||||
| 		static int minDensity() { assert(false); return 0; } | ||||
| 		static int maxDensity() { assert(false); return 0; } | ||||
| 	}; | ||||
|   | ||||
| @@ -92,10 +92,6 @@ namespace PolyVox | ||||
| 	public: | ||||
| 		typedef uint8_t DensityType; | ||||
| 		typedef uint8_t MaterialType; | ||||
| 		static const bool HasDensity = true; | ||||
| 		static const bool HasMaterial = true; | ||||
| 		static bool hasDensity() { return true; } | ||||
| 		static bool hasMaterial() { return true; } | ||||
| 		static MaterialDensityPair44::DensityType minDensity() { return 0; } | ||||
| 		static MaterialDensityPair44::DensityType maxDensity() { return 15; } | ||||
| 	}; | ||||
| @@ -106,10 +102,6 @@ namespace PolyVox | ||||
| 	public: | ||||
| 		typedef uint8_t DensityType; | ||||
| 		typedef uint8_t MaterialType; | ||||
| 		static const bool HasDensity = true; | ||||
| 		static const bool HasMaterial = true; | ||||
| 		static bool hasDensity() { return true; } | ||||
| 		static bool hasMaterial() { return true; } | ||||
| 		static MaterialDensityPair88::DensityType minDensity() { return 0; } | ||||
| 		static MaterialDensityPair88::DensityType maxDensity() { return 255; } | ||||
| 	}; | ||||
|   | ||||
| @@ -38,10 +38,6 @@ namespace PolyVox | ||||
| 	public: | ||||
| 		typedef uint8_t DensityType; | ||||
| 		typedef uint8_t MaterialType; | ||||
| 		static const bool HasDensity = true; | ||||
| 		static const bool HasMaterial = false; | ||||
| 		static bool hasDensity() { return true; } | ||||
| 		static bool hasMaterial() { return false; } | ||||
| 		static uint8_t minDensity() { return 0; } | ||||
| 		static uint8_t maxDensity() { return 255; } | ||||
| 	}; | ||||
|   | ||||
| @@ -48,11 +48,6 @@ namespace PolyVox | ||||
| 	public: | ||||
| 		typedef uint8_t DensityType; | ||||
| 		typedef uint8_t MaterialType; | ||||
| 		static const bool HasDensity = false; | ||||
| 		static const bool HasMaterial = false; | ||||
|  | ||||
| 		static bool hasDensity() { return false; } | ||||
| 		static bool hasMaterial() { return false; } | ||||
|  | ||||
| 		// These default implementations return an int32_t rather than void so that the result can be | ||||
| 		// assigned to a variable for all voxel types (even those without density components). Calls | ||||
|   | ||||
		Reference in New Issue
	
	Block a user