coeng
annotate 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 |
rev | line source |
---|---|
nuclear@0 | 1 #ifndef COMP_H_ |
nuclear@0 | 2 #define COMP_H_ |
nuclear@0 | 3 |
nuclear@1 | 4 #include <string> |
nuclear@0 | 5 #include <vmath/vmath.h> |
nuclear@0 | 6 |
nuclear@1 | 7 class GameObject; |
nuclear@1 | 8 |
nuclear@0 | 9 class Component { |
nuclear@1 | 10 protected: |
nuclear@1 | 11 char *name; |
nuclear@1 | 12 GameObject *parent; |
nuclear@1 | 13 int upd_prio; // update priority (0: normal) |
nuclear@1 | 14 |
nuclear@0 | 15 public: |
nuclear@0 | 16 Component() {} |
nuclear@0 | 17 virtual ~Component() {} |
nuclear@1 | 18 |
nuclear@1 | 19 const char *get_name() const; |
nuclear@1 | 20 |
nuclear@1 | 21 virtual void update(); |
nuclear@1 | 22 |
nuclear@1 | 23 bool operator <(const Component &c) const; // for sorting based on priority |
nuclear@1 | 24 }; |
nuclear@1 | 25 |
nuclear@1 | 26 class CompXForm : public Component { |
nuclear@1 | 27 public: |
nuclear@1 | 28 Matrix4x4 xform; |
nuclear@1 | 29 |
nuclear@1 | 30 CompXForm(); |
nuclear@0 | 31 }; |
nuclear@0 | 32 |
nuclear@0 | 33 class CompPRS : public Component { |
nuclear@1 | 34 private: |
nuclear@1 | 35 CompXForm *co_xform; // cached xform component of the parent object |
nuclear@1 | 36 |
nuclear@0 | 37 public: |
nuclear@0 | 38 Vector3 pos, scale; |
nuclear@0 | 39 Quaternion rot; |
nuclear@1 | 40 |
nuclear@1 | 41 void update(); |
nuclear@0 | 42 }; |
nuclear@0 | 43 |
nuclear@0 | 44 #endif // COMP_H_ |