forked from yozlet/interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparticle.h
More file actions
62 lines (51 loc) · 1.23 KB
/
Copy pathparticle.h
File metadata and controls
62 lines (51 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// particle.h
// interface
//
// Created by Seiji Emery on 9/4/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#ifndef interface_particle_h
#define interface_particle_h
#include "glm/glm.hpp"
#include "util.h"
#include "world.h"
#include <GLUT/glut.h>
class ParticleSystem {
public:
ParticleSystem(int num,
glm::vec3 box,
int wrap,
float noiselevel,
float setscale,
float setgravity);
void simulate(float deltaTime);
void render();
bool updateHand(glm::vec3 pos, glm::vec3 vel, float radius);
private:
struct Particle {
glm::vec3 position, velocity, color, link;
int element;
int parent;
float radius;
bool isColliding;
int numSprung;
} *particles;
unsigned int count;
glm::vec3 bounds;
float radius;
bool wrapBounds;
float noise;
float gravity;
float scale;
glm::vec3 color;
void link(int child, int parent);
// Manipulator from outside
void resetHand();
bool handActive;
bool handIsColliding;
glm::vec3 handPos;
glm::vec3 handVel;
float handRadius;
};
#endif