coeng
annotate src/sim.h @ 6:2f872a179914
first component test:
- prs, xform, physics components with dependencies
- topological sort of components to update them in the correct order
- debug visualization component
todo: remove draw() from components, doesn't make sense
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 14 Feb 2015 07:27:12 +0200 |
parents | |
children | 8cce82794f90 |
rev | line source |
---|---|
nuclear@6 | 1 #ifndef COENG_SIM_H_ |
nuclear@6 | 2 #define COENG_SIM_H_ |
nuclear@6 | 3 |
nuclear@6 | 4 #include <list> |
nuclear@6 | 5 #include "co_phys.h" |
nuclear@6 | 6 #include "gobj.h" |
nuclear@6 | 7 |
nuclear@6 | 8 class SimWorld { |
nuclear@6 | 9 private: |
nuclear@6 | 10 std::list<CoRigid*> rigid; |
nuclear@6 | 11 Vector3 gravity; |
nuclear@6 | 12 float damping; |
nuclear@6 | 13 |
nuclear@6 | 14 public: |
nuclear@6 | 15 SimWorld(); |
nuclear@6 | 16 |
nuclear@6 | 17 void add_object(GObject *obj); // convenience function, calls add_rigid_body |
nuclear@6 | 18 void add_rigid_body(CoRigid *co); |
nuclear@6 | 19 |
nuclear@6 | 20 void remove_object(GObject *obj); // convenience function, calls remove_rigid_body |
nuclear@6 | 21 void remove_rigid_body(CoRigid *co); |
nuclear@6 | 22 |
nuclear@6 | 23 void set_damping(float damping); |
nuclear@6 | 24 float get_damping() const; |
nuclear@6 | 25 |
nuclear@6 | 26 void set_gravity(const Vector3 &v); |
nuclear@6 | 27 const Vector3 &get_gravity() const; |
nuclear@6 | 28 }; |
nuclear@6 | 29 |
nuclear@6 | 30 #endif // COENG_SIM_H_ |