Removed use of template template parameters from AStarPathfinder.

This commit is contained in:
unknown
2012-06-05 16:33:29 +02:00
parent 8c02098088
commit c9e83f41f1
3 changed files with 28 additions and 28 deletions

View File

@ -45,8 +45,8 @@ namespace PolyVox
/// This function provides the default method for checking whether a given voxel
/// is valid for the path computed by the AStarPathfinder.
template< template<typename> class VolumeType, typename VoxelType>
bool aStarDefaultVoxelValidator(const VolumeType<VoxelType>* volData, const Vector3DInt32& v3dPos);
template<typename VolumeType>
bool aStarDefaultVoxelValidator(const VolumeType* volData, const Vector3DInt32& v3dPos);
/// Provides a configuration for the AStarPathfinder.
////////////////////////////////////////////////////////////////////////////////
@ -59,20 +59,20 @@ namespace PolyVox
///
/// \sa AStarPathfinder
////////////////////////////////////////////////////////////////////////////////
template< template<typename> class VolumeType, typename VoxelType>
template<typename VolumeType>
struct AStarPathfinderParams
{
public:
AStarPathfinderParams
(
VolumeType<VoxelType>* volData,
VolumeType* volData,
const Vector3DInt32& v3dStart,
const Vector3DInt32& v3dEnd,
std::list<Vector3DInt32>* listResult,
float fHBias = 1.0,
uint32_t uMaxNoOfNodes = 10000,
Connectivity connectivity = TwentySixConnected,
polyvox_function<bool (const VolumeType<VoxelType>*, const Vector3DInt32&)> funcIsVoxelValidForPath = &aStarDefaultVoxelValidator,
polyvox_function<bool (const VolumeType*, const Vector3DInt32&)> funcIsVoxelValidForPath = &aStarDefaultVoxelValidator,
polyvox_function<void (float)> funcProgressCallback = 0
)
:volume(volData)
@ -88,7 +88,7 @@ namespace PolyVox
}
/// This is the volume through which the AStarPathfinder must find a path.
VolumeType<VoxelType>* volume;
VolumeType* volume;
/// The start point for the pathfinding algorithm.
Vector3DInt32 start;
@ -127,7 +127,7 @@ namespace PolyVox
/// you could check to ensure that the voxel above is empty and the voxel below is solid.
///
/// \sa aStarDefaultVoxelValidator
polyvox_function<bool (const VolumeType<VoxelType>*, const Vector3DInt32&)> isVoxelValidForPath;
polyvox_function<bool (const VolumeType*, const Vector3DInt32&)> isVoxelValidForPath;
/// This function is called by the AStarPathfinder to report on its progress in getting to
/// the goal. The progress is reported by computing the distance from the closest node found
@ -161,11 +161,11 @@ namespace PolyVox
///
/// \sa AStarPathfinderParams
////////////////////////////////////////////////////////////////////////////////
template< template<typename> class VolumeType, typename VoxelType>
template<typename VolumeType>
class AStarPathfinder
{
public:
AStarPathfinder(const AStarPathfinderParams<VolumeType, VoxelType>& params);
AStarPathfinder(const AStarPathfinderParams<VolumeType>& params);
void execute();
@ -187,7 +187,7 @@ namespace PolyVox
float m_fProgress;
AStarPathfinderParams<VolumeType, VoxelType> m_params;
AStarPathfinderParams<VolumeType> m_params;
};
}