Removed the default value for emptyVoxelExample as it caused compile errors on VS2010.
This commit is contained in:
parent
ee299a45f0
commit
e405b46b61
@ -41,7 +41,7 @@ namespace PolyVox
|
|||||||
|
|
||||||
/// Pick the first solid voxel along a vector
|
/// Pick the first solid voxel along a vector
|
||||||
template<typename VolumeType>
|
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"
|
#include "PolyVoxCore/Picking.inl"
|
||||||
|
@ -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.didHit, true);
|
||||||
QCOMPARE(resultHit.hitVoxel, Vector3DInt32((uVolumeSideLength / 2) + 1, uVolumeSideLength / 2, uVolumeSideLength / 2));
|
QCOMPARE(resultHit.hitVoxel, Vector3DInt32((uVolumeSideLength / 2) + 1, uVolumeSideLength / 2, uVolumeSideLength / 2));
|
||||||
QCOMPARE(resultHit.previousVoxel, Vector3DInt32((uVolumeSideLength / 2), 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);
|
QCOMPARE(resultMiss.didHit, false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user