coeng

view src/comp.h @ 1:b0d8d454c546

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 05 Feb 2015 00:38:59 +0200
parents 14e743b53289
children 4a1c9597f4d3
line source
1 #ifndef COMP_H_
2 #define COMP_H_
4 #include <string>
5 #include <vmath/vmath.h>
7 class GameObject;
9 class Component {
10 protected:
11 char *name;
12 GameObject *parent;
13 int upd_prio; // update priority (0: normal)
15 public:
16 Component() {}
17 virtual ~Component() {}
19 const char *get_name() const;
21 virtual void update();
23 bool operator <(const Component &c) const; // for sorting based on priority
24 };
26 class CompXForm : public Component {
27 public:
28 Matrix4x4 xform;
30 CompXForm();
31 };
33 class CompPRS : public Component {
34 private:
35 CompXForm *co_xform; // cached xform component of the parent object
37 public:
38 Vector3 pos, scale;
39 Quaternion rot;
41 void update();
42 };
44 #endif // COMP_H_