erebus

annotate 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
rev   line source
nuclear@2 1 #ifndef SNODE_H_
nuclear@2 2 #define SNODE_H_
nuclear@2 3
nuclear@2 4 #include <vector>
nuclear@2 5 #include "object.h"
nuclear@2 6 #include "vmath/vmath.h"
nuclear@2 7
nuclear@2 8 class SceneNode {
nuclear@2 9 private:
nuclear@2 10 Vector3 pos;
nuclear@2 11 Quaternion rot;
nuclear@2 12 Vector3 scale;
nuclear@2 13
nuclear@2 14 std::vector<Object*> obj;
nuclear@2 15
nuclear@2 16 SceneNode *parent;
nuclear@2 17 std::vector<SceneNode*> children;
nuclear@2 18
nuclear@2 19 Matrix4x4 node_xform, xform;
nuclear@2 20
nuclear@2 21 public:
nuclear@2 22 void add_child(SceneNode *node);
nuclear@2 23 bool remove_child(SceneNode *node);
nuclear@2 24
nuclear@2 25 int get_num_children() const;
nuclear@2 26 SceneNode *get_child(int idx) const;
nuclear@2 27
nuclear@2 28 void set_position(const Vector3 &pos);
nuclear@2 29 void set_rotation(const Quaternion &rot);
nuclear@2 30 void set_scaling(const Vector3 &scale);
nuclear@2 31
nuclear@2 32 const Vector3 &get_node_position() const;
nuclear@2 33 const Quaternion &get_node_rotation() const;
nuclear@2 34 const Vector3 &get_node_scaling() const;
nuclear@2 35
nuclear@2 36 Vector3 get_position() const;
nuclear@2 37 Quaternion get_rotation() const;
nuclear@2 38 Vector3 get_scaling() const;
nuclear@2 39
nuclear@2 40 void update_node(long msec = 0);
nuclear@2 41 void update(long msec = 0);
nuclear@2 42
nuclear@2 43 bool intersect(const Ray &ray, RayHit *hit) const;
nuclear@2 44 };
nuclear@2 45
nuclear@2 46 #endif // SNODE_H_