rendering all objects belonging to each mirror
[laserbrain_demo] / src / metascene.cc
index eef5e65..ba5bdc2 100644 (file)
@@ -275,15 +275,17 @@ int MetaScene::calc_mirror_planes()
                                        mir->next = mirrors;
                                        mirrors = mir;
 
                                        mir->next = mirrors;
                                        mirrors = mir;
 
-                                       node = new FlatMirror;
-                                       node->wplane = mir->wplane;
-                                       node->next = planes;
+                                       // also add a node to the mirror plane matching list
+                                       FlatMirror *m = new FlatMirror;
+                                       m->wplane = mir->wplane;
+                                       m->next = planes;
                                        planes = node;
 
                                        mir->objects.push_back(obj);
                                        objmirror[obj] = mir;   // associate with object
                                        ++num_mirrors;
                                } else {
                                        planes = node;
 
                                        mir->objects.push_back(obj);
                                        objmirror[obj] = mir;   // associate with object
                                        ++num_mirrors;
                                } else {
+                                       node->objects.push_back(obj);
                                        delete mir;
                                }
                        }
                                        delete mir;
                                }
                        }