coeng

view src/co_phys.h @ 7:af24cfbdf9b6

adding collision detection
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 Feb 2015 10:08:00 +0200
parents 0e5da17d589c
children 8cce82794f90
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 float mass, elast, friction;
19 Vector3 vel, force;
20 Vector3 impulse;
22 CoRigid();
24 void add_impulse(const Vector3 &v);
26 void update(float dt);
27 };
29 #endif // COMP_PHYS_H_