erebus

diff liberebus/src/snode.h @ 0:4abdce1361b9

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 27 Apr 2014 16:02:47 +0300
parents
children 59a72293f9bd
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/liberebus/src/snode.h	Sun Apr 27 16:02:47 2014 +0300
     1.3 @@ -0,0 +1,41 @@
     1.4 +#ifndef SNODE_H_
     1.5 +#define SNODE_H_
     1.6 +
     1.7 +#include <vector>
     1.8 +#include "object.h"
     1.9 +#include "vmath/vmath.h"
    1.10 +
    1.11 +class SceneNode {
    1.12 +private:
    1.13 +	Vector3 pos;
    1.14 +	Quaternion rot;
    1.15 +	Vector3 scale;
    1.16 +
    1.17 +	std::vector<Object*> obj;
    1.18 +
    1.19 +	SceneNode *parent;
    1.20 +	std::vector<SceneNode*> children;
    1.21 +
    1.22 +public:
    1.23 +	void add_child(SceneNode *node);
    1.24 +
    1.25 +	int get_num_children() const;
    1.26 +	SceneNode *get_child(int idx) const;
    1.27 +
    1.28 +	void set_position(const Vector3 &pos);
    1.29 +	void set_rotation(const Quaternion &rot);
    1.30 +	void set_scaling(const Vector3 &scale);
    1.31 +
    1.32 +	const Vector3 &get_node_position() const;
    1.33 +	const Quaternion &get_node_rotation() const;
    1.34 +	const Vector3 &get_node_scaling() const;
    1.35 +
    1.36 +	const Vector3 &get_position() const;
    1.37 +	const Quaternion &get_rotation() const;
    1.38 +	const Vector3 &get_scaling() const;
    1.39 +
    1.40 +	void update_node(long msec = 0) const;
    1.41 +	void update(long msec = 0) const;
    1.42 +};
    1.43 +
    1.44 +#endif	// SNODE_H_
    1.45 \ No newline at end of file