coeng

view src/co_phys.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 COMP_PHYS_H_
2 #define COMP_PHYS_H_
4 #include <vmath/vmath.h>
5 #include "comp.h"
6 #include "co_xform.h"
8 class SimWorld;
10 class CoRigid : public Component {
11 protected:
12 CoPRS *co_prs; // cached PRS component of the parent object
14 const char **update_before() const;
16 public:
17 SimWorld *world;
18 bool fixed;
19 float mass, elast, friction;
20 Vector3 vel, force;
21 Vector3 impulse;
23 CoRigid();
25 void set_fixed(bool f);
26 bool get_fixed() const;
28 void set_mass(float mass);
29 float get_mass() const;
31 void add_impulse(const Vector3 &v);
33 void update(float dt);
34 };
36 // helper component accessors
37 CoRigid *gobj_co_rigid(const GObject *obj, bool nofail = true);
39 #endif // COMP_PHYS_H_