erebus
view liberebus/src/snode.h @ 2:474a0244f57d
fixed specialization mistake
fixed line endings
added makefiles
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 28 Apr 2014 06:31:10 +0300 |
parents | 59a72293f9bd |
children | a932848de652 |
line source
1 #ifndef SNODE_H_
2 #define SNODE_H_
4 #include <vector>
5 #include "object.h"
6 #include "vmath/vmath.h"
8 class SceneNode {
9 private:
10 Vector3 pos;
11 Quaternion rot;
12 Vector3 scale;
14 std::vector<Object*> obj;
16 SceneNode *parent;
17 std::vector<SceneNode*> children;
19 Matrix4x4 node_xform, xform;
21 public:
22 void add_child(SceneNode *node);
23 bool remove_child(SceneNode *node);
25 int get_num_children() const;
26 SceneNode *get_child(int idx) const;
28 void set_position(const Vector3 &pos);
29 void set_rotation(const Quaternion &rot);
30 void set_scaling(const Vector3 &scale);
32 const Vector3 &get_node_position() const;
33 const Quaternion &get_node_rotation() const;
34 const Vector3 &get_node_scaling() const;
36 Vector3 get_position() const;
37 Quaternion get_rotation() const;
38 Vector3 get_scaling() const;
40 void update_node(long msec = 0);
41 void update(long msec = 0);
43 bool intersect(const Ray &ray, RayHit *hit) const;
44 };
46 #endif // SNODE_H_