Fixed bug with SimpleVolume and negative positions.

This commit is contained in:
David Williams
2012-12-05 23:49:39 +01:00
parent 4ed8d4303b
commit 3f87fc780f
2 changed files with 12 additions and 11 deletions

View File

@ -34,8 +34,7 @@ using namespace PolyVox;
template <typename VolumeType>
int32_t complexVolumeTest(void)
{
//VolumeType testVolume(Region(-57, -31, 12, 64, 96, 131)); // Deliberatly awkward size
VolumeType testVolume(Region(0, 0, 0, 63, 63, 63));
VolumeType testVolume(Region(-57, -31, 12, 64, 96, 131)); // Deliberatly awkward size
for(int z = testVolume.getEnclosingRegion().getLowerZ(); z <= testVolume.getEnclosingRegion().getUpperZ(); z++)
{
for(int y = testVolume.getEnclosingRegion().getLowerY(); y <= testVolume.getEnclosingRegion().getUpperY(); y++)
@ -66,19 +65,19 @@ int32_t complexVolumeTest(void)
void TestVolume::testLargeVolume()
{
int32_t result = complexVolumeTest< LargeVolume<int32_t> >();
QCOMPARE(result, static_cast<int32_t>(24772608));
QCOMPARE(result, static_cast<int32_t>(201446400));
}
void TestVolume::testRawVolume()
{
int32_t result = complexVolumeTest< RawVolume<int32_t> >();
QCOMPARE(result, static_cast<int32_t>(24772608));
QCOMPARE(result, static_cast<int32_t>(201446400));
}
void TestVolume::testSimpleVolume()
{
int32_t result = complexVolumeTest< SimpleVolume<int32_t> >();
QCOMPARE(result, static_cast<int32_t>(24772608));
QCOMPARE(result, static_cast<int32_t>(201446400));
}
QTEST_MAIN(TestVolume)