nuclear@0: #ifndef COMP_H_ nuclear@0: #define COMP_H_ nuclear@0: nuclear@1: #include nuclear@0: #include nuclear@0: nuclear@1: class GameObject; nuclear@1: nuclear@0: class Component { nuclear@1: protected: nuclear@1: char *name; nuclear@1: GameObject *parent; nuclear@1: int upd_prio; // update priority (0: normal) nuclear@1: nuclear@0: public: nuclear@0: Component() {} nuclear@0: virtual ~Component() {} nuclear@1: nuclear@1: const char *get_name() const; nuclear@1: nuclear@1: virtual void update(); nuclear@1: nuclear@1: bool operator <(const Component &c) const; // for sorting based on priority nuclear@1: }; nuclear@1: nuclear@1: class CompXForm : public Component { nuclear@1: public: nuclear@1: Matrix4x4 xform; nuclear@1: nuclear@1: CompXForm(); nuclear@0: }; nuclear@0: nuclear@0: class CompPRS : public Component { nuclear@1: private: nuclear@1: CompXForm *co_xform; // cached xform component of the parent object nuclear@1: nuclear@0: public: nuclear@0: Vector3 pos, scale; nuclear@0: Quaternion rot; nuclear@1: nuclear@1: void update(); nuclear@0: }; nuclear@0: nuclear@0: #endif // COMP_H_