SceneNode bounds calculation
[laserbrain_demo] / src / snode.h
index b88c1ae..94ccb6a 100644 (file)
@@ -24,8 +24,8 @@ private:
        Mat4 xform;
        Mat4 inv_xform;
 
-       mutable bool bvol_valid;
-       mutable Box bvol;
+       mutable bool local_bvol_valid;
+       mutable AABox local_bvol;
 
 public:
        Scene *scene;   // scene to which this node belongs
@@ -74,8 +74,14 @@ public:
 
        bool intersect(const Ray &ray, HitPoint *hit) const;
 
-       const Box &calc_bounds();
-       const Box &get_bounds() const;
+       // cached local bounding box (all objects in this node in model space)
+       const AABox &calc_local_bounds();
+       const AABox &get_local_bounds() const;
+
+       // world bounding box of the node
+       AABox get_node_bounds() const;
+       // world bounding box of the node and it's subtree
+       AABox get_bounds() const;
 };
 
 #endif // SNODE_H_