-
Notifications
You must be signed in to change notification settings - Fork 0
/
SphereSystem.cpp
42 lines (38 loc) · 924 Bytes
/
SphereSystem.cpp
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
#include "SphereSystem.h"
#include <iostream>
#include <math.h>
SphereSystem::SphereSystem(Vector3f &pos, float r):ParticleSystem(1){
//
minDistance = 0.5;
impulseDistance = 0.2;
center = pos;
radius = r;
}
int SphereSystem::intersect(Vector3f& pos, Vector3f& v, Vector3f& normal){
float thickness = 0.02;
if ((pos-center).abs()<radius+thickness){
return 2;
}else if ((pos-center).abs()<radius+thickness+0.01){
return 1;
}
return 0;
}
vector<Vector3f> SphereSystem::evalF(vector<Vector3f> state)
{
vector<Vector3f> f;
vector<Vector3f> states = getState();
for(int i=0; i< m_numParticles; i++){
Vector3f newForce = Vector3f(0,0,0);
f.push_back(newForce);
f.push_back(newForce);
}
}
void SphereSystem::move(Vector3f displacement){
//return;
}
void SphereSystem::moveOne(Vector3f displacement){
//return;
}
void SphereSystem::draw(){
//return;
}