X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fmetascene.cc;h=ba05bce159a0f1cf5b4af4c8dccff5165a0b4dc4;hp=eef5e65120cb607d1238be9063f86c2645bf06ba;hb=1c6f12ce97d5cd85925a4b9ecab7591172f16ca1;hpb=e5c3a6764a288f04cffbf02164fec7a2c2d80dea diff --git a/src/metascene.cc b/src/metascene.cc index eef5e65..ba05bce 100644 --- a/src/metascene.cc +++ b/src/metascene.cc @@ -203,8 +203,6 @@ Scene *MetaScene::extract_nodes(const char *qstr) int MetaScene::calc_mirror_planes() { - FlatMirror *planes = 0; - int num_mirrors = 0; while(mirrors) { FlatMirror *m = mirrors; @@ -252,7 +250,7 @@ int MetaScene::calc_mirror_planes() // check to see if we have found this mirror plane already bool found = false; - FlatMirror *node = planes; + FlatMirror *node = mirrors; while(node) { float d1 = dot(mir->wplane.normal, mir->wplane.pt); float d2 = dot(node->wplane.normal, node->wplane.pt); @@ -275,27 +273,17 @@ int MetaScene::calc_mirror_planes() mir->next = mirrors; mirrors = mir; - node = new FlatMirror; - node->wplane = mir->wplane; - node->next = planes; - planes = node; - mir->objects.push_back(obj); objmirror[obj] = mir; // associate with object ++num_mirrors; } else { + node->objects.push_back(obj); delete mir; } } } } - while(planes) { - FlatMirror *tmp = planes; - planes = planes->next; - delete tmp; - } - return num_mirrors; }