X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fsnode.h;h=b88c1aec7a59caa97b0704bf4bfa995f067322c6;hp=11651c6636c320e0e367854ea3c5bb460d232625;hb=82a1d96d9a18e94ccdc13b4bda0c470e81e70768;hpb=873255c40ab793b8c569eca3728d918339686000 diff --git a/src/snode.h b/src/snode.h index 11651c6..b88c1ae 100644 --- a/src/snode.h +++ b/src/snode.h @@ -3,8 +3,11 @@ #include #include "object.h" +#include "geom.h" #include "gmath/gmath.h" +class Scene; + class SceneNode { private: char *name; @@ -21,7 +24,11 @@ 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; SceneNode(); @@ -63,7 +70,12 @@ public: void update_node(float dt = 0.0f); void update(float dt = 0.0f); + void apply_xform(); + bool intersect(const Ray &ray, HitPoint *hit) const; + + const Box &calc_bounds(); + const Box &get_bounds() const; }; #endif // SNODE_H_