From e405b46b612c20f951380b61b761788719f03d3c Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Tue, 14 May 2013 15:44:56 +0200 Subject: [PATCH] Removed the default value for emptyVoxelExample as it caused compile errors on VS2010. --- library/PolyVoxCore/include/PolyVoxCore/Picking.h | 2 +- tests/TestPicking.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Picking.h b/library/PolyVoxCore/include/PolyVoxCore/Picking.h index 96322ac2..ee757ddb 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Picking.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Picking.h @@ -41,7 +41,7 @@ namespace PolyVox /// Pick the first solid voxel along a vector template - 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" diff --git a/tests/TestPicking.cpp b/tests/TestPicking.cpp index 62fa8531..6271d004 100644 --- a/tests/TestPicking.cpp +++ b/tests/TestPicking.cpp @@ -52,14 +52,15 @@ 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); }