coeng
diff 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 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/sim.h Sat Feb 14 07:27:12 2015 +0200 1.3 @@ -0,0 +1,30 @@ 1.4 +#ifndef COENG_SIM_H_ 1.5 +#define COENG_SIM_H_ 1.6 + 1.7 +#include <list> 1.8 +#include "co_phys.h" 1.9 +#include "gobj.h" 1.10 + 1.11 +class SimWorld { 1.12 +private: 1.13 + std::list<CoRigid*> rigid; 1.14 + Vector3 gravity; 1.15 + float damping; 1.16 + 1.17 +public: 1.18 + SimWorld(); 1.19 + 1.20 + void add_object(GObject *obj); // convenience function, calls add_rigid_body 1.21 + void add_rigid_body(CoRigid *co); 1.22 + 1.23 + void remove_object(GObject *obj); // convenience function, calls remove_rigid_body 1.24 + void remove_rigid_body(CoRigid *co); 1.25 + 1.26 + void set_damping(float damping); 1.27 + float get_damping() const; 1.28 + 1.29 + void set_gravity(const Vector3 &v); 1.30 + const Vector3 &get_gravity() const; 1.31 +}; 1.32 + 1.33 +#endif // COENG_SIM_H_