aboutsummaryrefslogtreecommitdiff
path: root/demo/scenes/initialoverlap.h
diff options
context:
space:
mode:
authorMiles Macklin <[email protected]>2017-03-10 14:51:31 +1300
committerMiles Macklin <[email protected]>2017-03-10 14:51:31 +1300
commitad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f (patch)
tree4cc6f3288363889d7342f7f8407c0251e6904819 /demo/scenes/initialoverlap.h
downloadflex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.tar.xz
flex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.zip
Initial 1.1.0 binary release
Diffstat (limited to 'demo/scenes/initialoverlap.h')
-rw-r--r--demo/scenes/initialoverlap.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/demo/scenes/initialoverlap.h b/demo/scenes/initialoverlap.h
new file mode 100644
index 0000000..5c3abe4
--- /dev/null
+++ b/demo/scenes/initialoverlap.h
@@ -0,0 +1,30 @@
+
+
+// tests initial particle overlap, particle should be projected out of the box without high velocity
+class InitialOverlap : public Scene
+{
+public:
+
+ InitialOverlap(const char* name) : Scene(name) {}
+
+ virtual void Initialize()
+ {
+ g_params.radius = 0.1f;
+ g_params.numIterations = 2;
+
+ // test max acceleration clamping is working, test at 5x gravity
+ g_params.maxAcceleration = 50.0f;
+
+ // plinth
+ AddBox(1.0f, Vec3(0.0f, 0.0f, 0.0f));
+
+ g_buffers->positions.push_back(Vec4(0.0f, 0.5f, 0.0f, 1.0f));
+ g_buffers->velocities.push_back(Vec3(0.0f));
+ g_buffers->phases.push_back(0);
+
+ g_numSubsteps = 2;
+
+ // draw options
+ g_drawPoints = true;
+ }
+};