-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForceSphere.h
53 lines (41 loc) · 981 Bytes
/
ForceSphere.h
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
#ifndef FSPHERE_H
#define FSPHERE_H
#include <vecmath.h>
#include<vector>
#ifdef _WIN32
#include "GL/freeglut.h"
#else
#include <GL/glut.h>
#endif
using namespace std;
/*
Magnectic Field Sphere
This is the approximated model of magnetic field lines that Ferrofluids follow to form its shape.
@params
Vector3f Center: Center of Sphere
float Radius: Radius of Sphere
float Amplitude: Amplitude of Cos Wave kernel
int Peaks: Number of peaks per quarter of sphere
*/
class ForceSphere
{
public:
ForceSphere(void);
ForceSphere(Vector3f center, float radius, float amplitude, int peaks);
~ForceSphere(void);
void draw();
bool intersect(Vector3f point); //Point in world coordinates
Vector3f polarize(Vector3f position);
void move(Vector3f translate);
bool getSolid();
void setSolid(bool solid);
void setAmplitude(float amplitude);
float getAmplitude();
protected:
Vector3f m_center;
float m_radius;
float m_amplitude;
int m_peaks;
bool m_solid;
};
#endif