Removed the default value for emptyVoxelExample as it caused compile errors on VS2010.

This commit is contained in:
Daviw Williams 2013-05-14 15:44:56 +02:00
parent ee299a45f0
commit e405b46b61
2 changed files with 5 additions and 4 deletions

View File

@ -41,7 +41,7 @@ namespace PolyVox
/// Pick the first solid voxel along a vector
template<typename VolumeType>
PickResult pickVoxel(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, const typename VolumeType::VoxelType& emptyVoxelExample = typename VolumeType::VoxelType());
PickResult pickVoxel(VolumeType* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirectionAndLength, const typename VolumeType::VoxelType& emptyVoxelExample);
}
#include "PolyVoxCore/Picking.inl"

View File

@ -53,13 +53,14 @@ void TestPicking::testExecute()
}
}
PickResult resultHit = pickVoxel(&volData, Vector3DFloat(0, uVolumeSideLength / 2, uVolumeSideLength / 2), Vector3DFloat(uVolumeSideLength, 0, 0));
const int8_t emptyVoxelExample = 0; //A voxel value of zero will represent empty space.
PickResult resultHit = pickVoxel(&volData, Vector3DFloat(0, uVolumeSideLength / 2, uVolumeSideLength / 2), Vector3DFloat(uVolumeSideLength, 0, 0), emptyVoxelExample);
QCOMPARE(resultHit.didHit, true);
QCOMPARE(resultHit.hitVoxel, Vector3DInt32((uVolumeSideLength / 2) + 1, uVolumeSideLength / 2, uVolumeSideLength / 2));
QCOMPARE(resultHit.previousVoxel, Vector3DInt32((uVolumeSideLength / 2), uVolumeSideLength / 2, uVolumeSideLength / 2));
PickResult resultMiss = pickVoxel(&volData, Vector3DFloat(0, uVolumeSideLength / 2, uVolumeSideLength / 2), Vector3DFloat(uVolumeSideLength / 2, uVolumeSideLength, uVolumeSideLength));
PickResult resultMiss = pickVoxel(&volData, Vector3DFloat(0, uVolumeSideLength / 2, uVolumeSideLength / 2), Vector3DFloat(uVolumeSideLength / 2, uVolumeSideLength, uVolumeSideLength), emptyVoxelExample);
QCOMPARE(resultMiss.didHit, false);
}