cloth

view src/simworld.h @ 1:76d4b3e8e941

ksefyge
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 11 Feb 2013 19:48:47 +0200
parents 92983e143a03
children 2eac424f58b2
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_gravity(const Vector3 &f);
26 void add_particle(Particle *p);
28 bool collision(const Ray &ray, float rad, Collision *col) const;
30 void step(float dt);
32 void draw_particles() const;
34 friend class Particle;
35 };
37 #endif // SIMWORLD_H_