-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticleHelper.h
More file actions
116 lines (100 loc) · 2.45 KB
/
Copy pathParticleHelper.h
File metadata and controls
116 lines (100 loc) · 2.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
#pragma once
#include "Camera.h"
// THIS IS FOR SIZE______________________________________________
struct constB
{
};
struct VertexCb : public constB {
struct {
DirectX::XMMATRIX element;
}transform;
struct {
DirectX::XMMATRIX element;
}view;
struct {
DirectX::XMMATRIX element;
}projection;
};
struct PixelCb : constB {
struct {
float element[4];
}kd;
struct {
float element[4];
}ks;
struct {
float element[4];
}ka;
};
struct GeoCb {
struct {
float element[4];
}cameraPos;
struct {
float element[4];
}uvCords;
struct {
DirectX::XMMATRIX element;
}lightView;
};
//___________________________________________________________________
struct vector_3 {
vector_3(float a, float b, float c) {
this->x = a;
this->y = b;
this->z = c;
}
vector_3() {
this->x = 0;
this->y = 0;
this->z = 0;
}
vector_3 Normalize();
vector_3 X(const vector_3& other);
float operator*(vector_3& other);//dot
vector_3 operator*(float other);
vector_3 mul(float other);
vector_3 mul(vector_3 other);
vector_3 operator/(vector_3 other);
vector_3 operator+(vector_3 other);
vector_3 operator-(vector_3 other);
vector_3 mirror();
bool operator==(vector_3& other);
void operator=(vector_3 other);
void operator=(std::array<float, 3> other);
const DirectX::XMVECTOR toXMVECTOR();
float length();
std::string to_string() {
//return "x: " + std::to_string(x) + " y: " + std::to_string(y) + " z: " + std::to_string(z);
return std::to_string(x) + ", " + std::to_string(y) + ", " + std::to_string(z);
}
float x;
float y;
float z;
};
struct vector_4 {
vector_4() {
};
vector_4(float a, float b, float c, float d) {
xyz.x = a;
xyz.y = b;
xyz.z = c;
w = d;
}
vector_3 xyz;
float w;
};
struct point {
float pos[3];
point(vector_3 dot) { //dot som i punkt
this->pos[0] = dot.x;
this->pos[1] = dot.y;
this->pos[2] = dot.z;
}
};
bool loadComputeShader(std::string name, ID3D11Device* device, ID3D11ComputeShader*& computeShader);
float Randomizer(float min, float max);
bool CreateVertexConstantBuffer(ID3D11Device* device, ID3D11Buffer*& buffer, Camera& camera);
bool CreateGeometryConstantBuffer(ID3D11Device* device, ID3D11Buffer*& buffer);
bool CreatePixelConstantBuffer(ID3D11Device* device, ID3D11Buffer*& buffer);
bool CreateConstBuffer(ID3D11Device* device, ID3D11Buffer*& buffer, UINT size, constB* initData);