From e8ce60d275c8450bf7740c2558de46279edf69d1 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 16 Oct 2013 21:42:55 -0700 Subject: [PATCH] implement support for three children encoding --- voxel-edit/src/main.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/voxel-edit/src/main.cpp b/voxel-edit/src/main.cpp index 38375c1b0d..244db390df 100644 --- a/voxel-edit/src/main.cpp +++ b/voxel-edit/src/main.cpp @@ -1,4 +1,4 @@ -// + // // main.cpp // Voxel Edit // @@ -326,9 +326,39 @@ void unitTest(VoxelTree * tree) { } tree->createVoxel(0, 0, 0, voxelSize, 255, 255 ,255); + if (tree->getVoxelAt(0, 0, 0, voxelSize)) { + printf("corner point 0,0,0 exists...\n"); + } else { + printf("corner point 0,0,0 does not exists...\n"); + } + tree->createVoxel(voxelSize, 0, 0, voxelSize, 255, 255 ,255); + if (tree->getVoxelAt(voxelSize, 0, 0, voxelSize)) { + printf("corner point voxelSize,0,0 exists...\n"); + } else { + printf("corner point voxelSize,0,0 does not exists...\n"); + } + tree->createVoxel(0, 0, voxelSize, voxelSize, 255, 255 ,255); + if (tree->getVoxelAt(0, 0, voxelSize, voxelSize)) { + printf("corner point 0, 0, voxelSize exists...\n"); + } else { + printf("corner point 0, 0, voxelSize does not exists...\n"); + } + tree->createVoxel(voxelSize, 0, voxelSize, voxelSize, 255, 255 ,255); + if (tree->getVoxelAt(voxelSize, 0, voxelSize, voxelSize)) { + printf("corner point voxelSize, 0, voxelSize exists...\n"); + } else { + printf("corner point voxelSize, 0, voxelSize does not exists...\n"); + } + + printf("check root voxel exists...\n"); + if (tree->getVoxelAt(0,0,0,1.0)) { + printf("of course it does\n"); + } else { + printf("WTH!?!\n"); + } }