forked from michal1000w/GPUSmoke
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObject.h
More file actions
121 lines (101 loc) · 3.45 KB
/
Object.h
File metadata and controls
121 lines (101 loc) · 3.45 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#ifndef __OBJECT__
#define __OBJECT__
#include <string>
#include <iostream>
#include "cutil_math.h"
#include <cuda_runtime.h>
#include "double_buffer.cpp"
#define PARTICLE 0
#define EMITTER 1
#define SMOKE -1 //depricated
#define EXPLOSION 2
#define VDBOBJECT 3
#define VDBSINGLE 4
#define FORCE_FIELD_FORCE 5
#define FORCE_FIELD_POWER 6
#define FORCE_FIELD_TURBULANCE 7
#define FORCE_FIELD_WIND 8
#define COLLISION_SPHERE 9
#define MS_TO_SEC 0.001
class Solver;
class OBJECT {
public:
friend class Solver;
//Contructors
//OBJECT(std::string type = "SMOKE", float size = 1.0f, float initial_velocity = 0.0f, float velocity_frequence = 0.0f, float3 location = make_float3(0.0,0.0,0.0), int number = -1);
OBJECT(std::string type = "SMOKE", float size = 1.0f, float initial_velocity = 0.0f, float velocity_frequence = 0.0f,float Temp = 5.0f, float Density = 0.9f, float3 location = make_float3(0.0, 0.0, 0.0), int number = -1, int deviceCount = 1);
OBJECT(std::string type, float size, std::vector<std::vector<float3>> velocities, std::vector<std::vector<float3>> positions, float3 location, float Temp = 5.0f, float Density = 0.9f, int number = -1, int deviceCount = 1);
OBJECT(std::string type, float size, float3 location, float Temp = 5.0f, float Density = 0.9f, int number = -1, int deviceCount = 1);
OBJECT(OBJECT obj, int number, int deviceCount);
~OBJECT() {
}
//SETTERS-GETTERS
std::string get_type();
std::string get_type2();
void set_type(std::string type = "emitter");
float get_size();
void set_size(float size = 1.0f);
float get_initial_velocity();
void set_initial_velocity(float velocity = 1.0f);
float get_velocity_frequence();
void set_velocity_frequence(float frequence = 0.9f);
float get_impulseTemp();
void set_impulseTemp(float temp = 5.0f);
float get_impulseDensity();
void set_impulseDensity(float density = 0.6f);
float3 get_location();
void set_location(float x = 0, float y = 0, float z = 0);
void set_location(float3 location);
void load_density_grid(GRID3D obj,float temp,int deviceIndex);
GRID3D get_density_grid();
float get_initial_temp();
void cudaFree() { vdb_object.freeCuda(); }
void free() {
vdb_object.free();
}
std::string get_object();
std::string get_name();
void set_name(std::string);
void set_force_strength(float strength) { force_strength = strength; }
float get_force_strength() const { return force_strength; }
void reset();
void update();
void UpdateLocation() {this->location.x = Location[0];this->location.y = Location[1];this->location.z = Location[2];}
void LoadParticles();
void LoadObjects(int3,int,int,int a = NULL);
bool selected;
float Location[3];
float size;
float initial_size;
float force_strength;
bool square = false;
int type;
float initial_velocity;
float force_direction[3] = { 1.0,0,0 };
float velocity_frequence;
bool vel_freq_mov = true;
float set_vel_freq;
float max_vel_freq = 20.0;
float vel_freq_step = 0.4;
float impulseTemp;
int frame_range_min = 0;
int frame_range_max = 30;
float3 previous_location;
float previous_size;
bool edit_frame = false;
bool edit_frame_translation = false;
float3 velocity;
std::vector<std::vector<float3>> velocities;
std::vector<std::vector<float3>> positions;
float scale = 1.0f;
std::string particle_filepath = "";
GRID3D vdb_object;
std::vector<unsigned int*> collisions;
bool is_emitter = false;
private:
float impulseDensity;
float3 location;
float initial_temperature;
std::string name;
};
#endif // !OBJECT