cloth

view src/simworld.h @ 2:2eac424f58b2

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 12 Feb 2013 00:23:40 +0200
parents 76d4b3e8e941
children 28a31079dcdf
line source
1 #ifndef SIMWORLD_H_
2 #define SIMWORLD_H_
4 #include <vector>
5 #include "particle.h"
6 #include "vmath/vmath.h"
7 #include "object.h"
9 struct Collision {
10 float dist;
11 Vector3 pos;
12 Vector3 normal;
13 float elast;
14 };
16 class SimWorld {
17 private:
18 std::vector<Object*> objects;
19 std::vector<Particle*> part;
20 Vector3 grav;
21 float damping;
23 public:
24 SimWorld();
26 void set_gravity(const Vector3 &f);
28 void add_particle(Particle *p);
30 bool collision(const Ray &ray, float rad, Collision *col) const;
32 void step(float dt);
34 void draw_particles() const;
36 friend class Particle;
37 };
39 #endif // SIMWORLD_H_