6 #include "gmath/gmath.h"
18 std::vector<Object*> obj;
21 std::vector<SceneNode*> children;
27 Scene *scene; // scene to which this node belongs
31 explicit SceneNode(Object *obj);
34 void set_name(const char *s);
35 const char *get_name() const;
37 void add_child(SceneNode *node);
38 bool remove_child(SceneNode *node);
40 int get_num_children() const;
41 SceneNode *get_child(int idx) const;
43 SceneNode *get_parent() const;
45 void add_object(Object *obj);
46 bool remove_object(Object *obj);
48 int get_num_objects() const;
49 Object *get_object(int idx) const;
51 void set_position(const Vec3 &pos);
52 void set_rotation(const Quat &rot);
53 void set_scaling(const Vec3 &scale);
55 const Vec3 &get_node_position() const;
56 const Quat &get_node_rotation() const;
57 const Vec3 &get_node_scaling() const;
59 Vec3 get_position() const;
60 Quat get_rotation() const;
61 Vec3 get_scaling() const;
63 const Mat4 &get_matrix() const;
64 const Mat4 &get_inv_matrix() const;
66 void update_node(float dt = 0.0f);
67 void update(float dt = 0.0f);
71 bool intersect(const Ray &ray, HitPoint *hit) const;