-
Notifications
You must be signed in to change notification settings - Fork 14
/
realtime_analysis.h
66 lines (59 loc) · 1.69 KB
/
realtime_analysis.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
enum
{
eCalculateDensitiesShd,
eCalculatePressureForceShd,
eCalculateViscosityShd,
eExternalForcesShd,
eUpdatePositionsShd,
eUpdateSpatialHashShd,
eBitonicSort,
eBitonicSortOffsets,
numCompShaders
};
static DH::ParticleSetting TestA = {
.gravity = -9.8f,
.collisionDamping = 0.25f,
.smoothingRadius = 0.25f,
.targetDensity = 200,
.pressureMultiplier = 15,
.nearPressureMultiplier = 15,
.viscosityStrength = 0.01f,
.boundsMultiplier = 10,
};
static DH::ParticleSetting TestB = {
.gravity = 0,
.collisionDamping = 0.95f,
.smoothingRadius = 0.35f,
.targetDensity = 200,
.pressureMultiplier = 40,
.nearPressureMultiplier = 30,
.viscosityStrength = 0.06f,
.boundsMultiplier = 12,
};
static DH::ParticleSetting TestC = {
.gravity = -3,
.collisionDamping = 0.90f,
.smoothingRadius = 0.65f,
.targetDensity = 200,
.pressureMultiplier = 50,
.nearPressureMultiplier = 20,
.viscosityStrength = 0.04f,
.boundsMultiplier = 10,
};
static DH::ParticleSetting TestD = {
.gravity = 0,
.collisionDamping = 0.95f,
.smoothingRadius = 0.3f,
.targetDensity = 13,
.pressureMultiplier = 1,
.nearPressureMultiplier = 1,
.viscosityStrength = 0.02f,
.boundsMultiplier = 9,
};
template <typename T> // Return memory usage size
inline size_t getShaderSize(const std::vector<T>& vec)
{
using baseType = typename std::remove_reference<T>::type;
return sizeof(baseType) * vec.size();
}