coeng
annotate src/co_phys.h @ 9:49fdb15f1100
added makefile rule to download and unpack the obj file
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 15 Feb 2015 05:23:09 +0200 |
parents | 2f872a179914 |
children |
rev | line source |
---|---|
nuclear@0 | 1 #ifndef COMP_PHYS_H_ |
nuclear@0 | 2 #define COMP_PHYS_H_ |
nuclear@0 | 3 |
nuclear@0 | 4 #include <vmath/vmath.h> |
nuclear@0 | 5 #include "comp.h" |
nuclear@6 | 6 #include "co_xform.h" |
nuclear@6 | 7 |
nuclear@6 | 8 class SimWorld; |
nuclear@0 | 9 |
nuclear@5 | 10 class CoRigid : public Component { |
nuclear@6 | 11 protected: |
nuclear@6 | 12 CoPRS *co_prs; // cached PRS component of the parent object |
nuclear@6 | 13 |
nuclear@6 | 14 const char **update_before() const; |
nuclear@6 | 15 |
nuclear@0 | 16 public: |
nuclear@6 | 17 SimWorld *world; |
nuclear@8 | 18 bool fixed; |
nuclear@0 | 19 float mass, elast, friction; |
nuclear@6 | 20 Vector3 vel, force; |
nuclear@6 | 21 Vector3 impulse; |
nuclear@0 | 22 |
nuclear@5 | 23 CoRigid(); |
nuclear@3 | 24 |
nuclear@8 | 25 void set_fixed(bool f); |
nuclear@8 | 26 bool get_fixed() const; |
nuclear@8 | 27 |
nuclear@8 | 28 void set_mass(float mass); |
nuclear@8 | 29 float get_mass() const; |
nuclear@8 | 30 |
nuclear@6 | 31 void add_impulse(const Vector3 &v); |
nuclear@6 | 32 |
nuclear@6 | 33 void update(float dt); |
nuclear@0 | 34 }; |
nuclear@0 | 35 |
nuclear@8 | 36 // helper component accessors |
nuclear@8 | 37 CoRigid *gobj_co_rigid(const GObject *obj, bool nofail = true); |
nuclear@8 | 38 |
nuclear@0 | 39 #endif // COMP_PHYS_H_ |