Made raycasting, ambient occlusion, and A* pathfinding independant of volume type.

This commit is contained in:
David Williams
2011-05-01 17:26:12 +01:00
parent 27968973a4
commit 6a38d9fca7
8 changed files with 68 additions and 66 deletions

View File

@ -26,12 +26,12 @@ freely, subject to the following restrictions:
namespace PolyVox
{
template <typename VoxelType>
template< template<typename> class VolumeType, typename VoxelType>
class RaycastWithCallback
{
public:
///Constructor
RaycastWithCallback(LargeVolume<VoxelType>* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirection, polyvox_function<bool(const Vector3DInt32& position)> funcCallback);
RaycastWithCallback(VolumeType<VoxelType>* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirection, polyvox_function<bool(const Vector3DInt32& position)> funcCallback);
///Sets the start position for the ray.
void setStart(const Vector3DFloat& v3dStart);
@ -46,8 +46,8 @@ namespace PolyVox
void doRaycast(float x1, float y1, float z1, float x2, float y2, float z2);
LargeVolume<VoxelType>* m_volData;
typename LargeVolume<VoxelType>::Sampler m_sampVolume;
VolumeType<VoxelType>* m_volData;
typename VolumeType<VoxelType>::Sampler m_sampVolume;
Vector3DFloat m_v3dStart;
Vector3DFloat m_v3dDirection;