coeng

view src/co_phys.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 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_