diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-03-03 17:41:37 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-03-03 17:41:37 (GMT) |
commit | bacaa2b1b916f7672e2b971337232caef9cb22a2 (patch) | |
tree | 600980169762db7de33d29767fc0b7470000aeec /tests/csgtestcore.cc | |
parent | 2b2dc7a078e92193f0d27d901d3a1b4af9f5a1d9 (diff) |
fix bugs in testing
Diffstat (limited to 'tests/csgtestcore.cc')
-rw-r--r-- | tests/csgtestcore.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/csgtestcore.cc b/tests/csgtestcore.cc index 02ca0be..5820e44 100644 --- a/tests/csgtestcore.cc +++ b/tests/csgtestcore.cc @@ -167,8 +167,7 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) Tree tree(root_node); CsgInfo csgInfo = CsgInfo(); - int result = csgInfo.prep_chains( tree ); - if ( result == 1 ) return result; + if ( !csgInfo.prep_chains( tree ) ) return 1; fs::current_path(original_path); @@ -180,18 +179,18 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) } if (sysinfo_dump) cout << info_dump(csgInfo.glview); - VectorCamera vc; - vc.center << 0,0,0; + Camera camera(Camera::VECTOR); + camera.center << 0,0,0; double radius = 1.0; if (csgInfo.root_chain) { BoundingBox bbox = csgInfo.root_chain->getBoundingBox(); - vc.center = (bbox.min() + bbox.max()) / 2; + camera.center = (bbox.min() + bbox.max()) / 2; radius = (bbox.max() - bbox.min()).norm() / 2; } Vector3d cameradir(1, 1, -0.5); - vc.eye = vc.center - radius*1.8*cameradir; - csgInfo.glview->setCamera(vc); + camera.eye = camera.center - radius*1.8*cameradir; + csgInfo.glview->setCamera(camera); OpenCSGRenderer opencsgRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain, csgInfo.glview->shaderinfo); ThrownTogetherRenderer thrownTogetherRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain); |