coeng

view src/sim.h @ 8:8cce82794f90

seems to work nicely
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 15 Feb 2015 05:14:20 +0200
parents 2f872a179914
children
line source
1 #ifndef COENG_SIM_H_
2 #define COENG_SIM_H_
4 #include <list>
5 #include "co_phys.h"
6 #include "co_collider.h"
7 #include "gobj.h"
9 class SimWorld {
10 private:
11 std::list<CoRigid*> rigid;
12 Vector3 gravity;
13 float damping;
15 public:
16 SimWorld();
18 void add_object(GObject *obj); // convenience function, calls add_rigid_body
19 void add_rigid_body(CoRigid *co);
21 void remove_object(GObject *obj); // convenience function, calls remove_rigid_body
22 void remove_rigid_body(CoRigid *co);
24 void set_damping(float damping);
25 float get_damping() const;
27 void set_gravity(const Vector3 &v);
28 const Vector3 &get_gravity() const;
30 bool collide(const GObject *obj, HitPoint *hit = 0) const;
31 bool collide(const CoCollider *col, HitPoint *hit = 0) const;
32 };
34 #endif // COENG_SIM_H_