projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor changes (bounds lazy eval state)
[laserbrain_demo]
/
src
/
snode.h
diff --git
a/src/snode.h
b/src/snode.h
index
11651c6
..
b88c1ae
100644
(file)
--- a/
src/snode.h
+++ b/
src/snode.h
@@
-3,8
+3,11
@@
#include <vector>
#include "object.h"
#include <vector>
#include "object.h"
+#include "geom.h"
#include "gmath/gmath.h"
#include "gmath/gmath.h"
+class Scene;
+
class SceneNode {
private:
char *name;
class SceneNode {
private:
char *name;
@@
-21,7
+24,11
@@
private:
Mat4 xform;
Mat4 inv_xform;
Mat4 xform;
Mat4 inv_xform;
+ mutable bool bvol_valid;
+ mutable Box bvol;
+
public:
public:
+ Scene *scene; // scene to which this node belongs
Mat4 dbg_xform;
SceneNode();
Mat4 dbg_xform;
SceneNode();
@@
-63,7
+70,12
@@
public:
void update_node(float dt = 0.0f);
void update(float dt = 0.0f);
void update_node(float dt = 0.0f);
void update(float dt = 0.0f);
+ void apply_xform();
+
bool intersect(const Ray &ray, HitPoint *hit) const;
bool intersect(const Ray &ray, HitPoint *hit) const;
+
+ const Box &calc_bounds();
+ const Box &get_bounds() const;
};
#endif // SNODE_H_
};
#endif // SNODE_H_