cloth
view src/simworld.h @ 0:92983e143a03
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 11 Feb 2013 19:40:36 +0200 |
parents | |
children | 76d4b3e8e941 |
line source
1 #ifndef SIMWORLD_H_
2 #define SIMWORLD_H_
4 #include <vector>
5 #include "particle.h"
6 #include "vmath/vmath.h"
8 struct Collision {
9 Vector3 pos;
10 Vector3 normal;
11 float elast;
12 };
14 class SimWorld {
15 private:
16 std::vector<Object*> objects;
17 std::vector<Particle*> part;
18 Vector3 grav;
19 float damping;
21 public:
22 SimWorld();
24 void set_bounds(float xmin, float xmax, float ymin, float ymax);
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_