minor changes (bounds lazy eval state)
[laserbrain_demo] / src / snode.h
index 5af02f4..b88c1ae 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <vector>
 #include "object.h"
+#include "geom.h"
 #include "gmath/gmath.h"
 
 class Scene;
@@ -23,6 +24,9 @@ private:
        Mat4 xform;
        Mat4 inv_xform;
 
+       mutable bool bvol_valid;
+       mutable Box bvol;
+
 public:
        Scene *scene;   // scene to which this node belongs
        Mat4 dbg_xform;
@@ -69,6 +73,9 @@ public:
        void apply_xform();
 
        bool intersect(const Ray &ray, HitPoint *hit) const;
+
+       const Box &calc_bounds();
+       const Box &get_bounds() const;
 };
 
 #endif // SNODE_H_