From c55b8694e73bbf8f311ae85470130f4635e7f341 Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Dev Date: Mon, 25 Dec 2017 05:44:14 +0500 Subject: [PATCH] particles testing --- assets/config.json | 2 +- assets/effects/O-func.json | 100 ++++++++++++ assets/effects/S-func.json | 25 ++- assets/effects/magic-stars.json | 205 +++++++++++++++++++++-- assets/effects/sine-comets.json | 11 +- assets/effects/sine-sparks.json | 11 +- assets/effects/sparkler-looped.json | 91 +++++++++++ assets/effects/sparkler.json | 8 +- assets/effects/test.json | 243 +++++++++++++++++++++++----- assets/textures/circle-white.png | Bin 0 -> 2589 bytes assets/textures/rect-white.png | Bin 0 -> 2351 bytes assets/textures/star-white.png | Bin 0 -> 2820 bytes game/main_code.cpp | 16 +- game/main_code.h | 2 +- 14 files changed, 614 insertions(+), 100 deletions(-) create mode 100755 assets/effects/O-func.json create mode 100755 assets/effects/sparkler-looped.json create mode 100755 assets/textures/circle-white.png create mode 100755 assets/textures/rect-white.png create mode 100755 assets/textures/star-white.png diff --git a/assets/config.json b/assets/config.json index 7f5371e..0d41564 100755 --- a/assets/config.json +++ b/assets/config.json @@ -1,3 +1,3 @@ { - "effect": "effects/sparkler.json" + "effect": "effects/magic-stars.json" } \ No newline at end of file diff --git a/assets/effects/O-func.json b/assets/effects/O-func.json new file mode 100755 index 0000000..0a4b40b --- /dev/null +++ b/assets/effects/O-func.json @@ -0,0 +1,100 @@ +{ + "name": "Sparkler - бенгальский огонь", + + "emitters": + [ + { + "name": "Spark", + + "maxParticles": 300, + "preloading": 100, + "texturePath": "textures/spark.png", + + "hasInertion": "false", + "gravity": [0, 0, 0], + + "spawnRange_system": "PARTICLE_EFFECT", + + "spawnTotal": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0, + "value": 0 + }, + { + "t": 1, + "value": 5 + } + ] + }, + + "spawnRange": + { + "value": [ 0, 0, 0, 0 ] + }, + + "lifeTime": + { + "value": 2 + }, + + "coords_system": "PARTICLE_BIRTH", + "coords_axis_system": "PARTICLE_BIRTH", + "rotation_system": "PARTICLE_EFFECT", + + "coords": + { + "interpolation": "CUBIC_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": [ 100, 0, 0] + }, + { + "t": 0.1, + "value": [ 95, 30, 0] + }, + { + "t": 0.5, + "value": [ 0, 100, 0] + }, + { + "t": 1.0, + "value": [ -100, 0, 0] + }, + { + "t": 1.5, + "value": [ 0, -100, 0] + }, + { + "t": 1.9, + "value": [ 95, -30, 0] + }, + { + "t": 2.000, + "value": [ 100, 0, 0] + } + ] + }, + + "rotation": + { + "value": [ 0, 0, 0 ] + }, + + "scale": + { + "value": [ 10, 10 ] + }, + + "color": + { + "value": [ 1, 1, 0, 1 ] + } + } + ] +} \ No newline at end of file diff --git a/assets/effects/S-func.json b/assets/effects/S-func.json index 5a41e85..02696c9 100755 --- a/assets/effects/S-func.json +++ b/assets/effects/S-func.json @@ -38,8 +38,7 @@ "lifeTime": { - "min": 2, - "max": 2 + "value": 2 }, "coords_system": "PARTICLE_EFFECT", @@ -56,20 +55,20 @@ "value": [ 0, 0, 0] }, { - "t": 0.500, + "t": 0.5, "value": [ 50, 20, 0] }, { - "t": 1.000, - "value": [ 100, 150, 0] + "t": 1.0, + "value": [ 100, 100, 0] }, { - "t": 1.500, - "value": [ 150, 280, 0] + "t": 1.5, + "value": [ 150, 180, 0] }, { - "t": 2, - "value": [ 200, 300, 0] + "t": 2.000, + "value": [ 200, 200, 0] } ] }, @@ -81,13 +80,7 @@ "scale": { - "interpolation": "DISCRETE", - "timeline": - [ - { - "value": [ 10, 10 ] - } - ] + "value": [ 10, 10 ] }, "color": diff --git a/assets/effects/magic-stars.json b/assets/effects/magic-stars.json index f5256be..be5416c 100755 --- a/assets/effects/magic-stars.json +++ b/assets/effects/magic-stars.json @@ -4,10 +4,9 @@ "emitters": [ { - "name": "Spark", + "name": "Magic Star", - "maxParticles": 300, - "preloading": 100, + "preloading": 20, "texturePath": "textures/magic-star.png", "hasInertion": "false", @@ -26,20 +25,20 @@ }, { "t": 1, - "value": 1 + "value": 2 } ] }, "spawnRange": { - "value": [ 0, 45, 0, 45 ] + "value": [ 0, 30, 0, 45 ] }, "lifeTime": { "min": 1.5, - "max": 2.5 + "max": 3 }, "coords_system": "PARTICLE_BIRTH", @@ -56,9 +55,9 @@ "value": [ 0, 0, 0 ] }, { - "t": 2.000, - "min": [ 400, 0, 0 ], - "max": [ 400, 0, 0 ] + "t": 1.000, + "min": [ 300, 0, 0 ], + "max": [ 300, 0, 0 ] } ] }, @@ -82,7 +81,195 @@ "color": { "value": [ 1, 1, 1, 1 ] + }, + + "emitters": + [ + { + "name": "Spark", + + "matchDeathTime": "true", + + "maxParticles": 110, + "preloading": 110, + "texturePath": "textures/spark-white.png", + + "gravity": [0, -100, 0], + + "spawnRange_system": "PARTICLE_BIRTH", + + "spawnTotal": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": 0 + }, + { + "t": 1, + "value": 50 + } + ] + }, + + "spawnRange": + { + "value": [ 0, 0, 0, 360 ] + }, + + "lifeTime": + { + "min": 1, + "max": 2 + }, + + "coords_system": "PARTICLE_BIRTH", + "coords_axis_system": "PARTICLE_BIRTH", + "rotation_system": "PARTICLE_BIRTH", + + "coords": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 0, 0 ] + }, + { + "t": 1.000, + "min": [ 0, 0, 0 ], + "max": [ 50, 0, 0 ] + } + ] + }, + + "rotation": + { + "value": [ 0, 0, 0 ] + }, + + "scale": + { + "value": [ 10, 10 ] + }, + + "color": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 1, 1, 1 ] + }, + { + "t": 1.000, + "value": [ 0, 0, 1, 1 ] + }, + { + "t": 1.200, + "value": [ 0, 0, 1, 0 ] + } + ] + } + }, + { + "name": "Spark", + + "matchParentDeathTime": "true", + "matchDeathTime": "true", + + "maxParticles": 300, + "preloading": 300, + "texturePath": "textures/spark-white.png", + + "hasInertion": "true", + "gravity": [0, -100, 0], + + "spawnRange_system": "PARTICLE_BIRTH", + + "spawnTotal": + { + "interpolation": "DISCRETE", + "timeline": + [ + { + "t": 0.000, + "value": 0 + }, + { + "t": 2.000, + "value": 300 + } + ] + }, + + "spawnRange": + { + "value": [ 0, 0, 0, 360 ] + }, + + "lifeTime": + { + "min": 1, + "max": 2 + }, + + "coords_system": "PARTICLE_BIRTH", + "coords_axis_system": "PARTICLE_BIRTH", + "rotation_system": "PARTICLE_BIRTH", + + "coords": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 0, 0 ] + }, + { + "t": 1.000, + "min": [ 25, 0, 0 ], + "max": [ 300, 0, 0 ] + } + ] + }, + + "rotation": + { + "value": [ 0, 0, 0 ] + }, + + "scale": + { + "value": [ 10, 10 ] + }, + + "color": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": [ 1, 1, 0, 1 ] + }, + { + "t": 1.000, + "value": [ 1, 0, 0, 1 ] + }, + { + "t": 1.200, + "value": [ 1, 0, 0, 0 ] + } + ] + } } + ] } ] } \ No newline at end of file diff --git a/assets/effects/sine-comets.json b/assets/effects/sine-comets.json index d29eeb8..5892f56 100755 --- a/assets/effects/sine-comets.json +++ b/assets/effects/sine-comets.json @@ -38,8 +38,7 @@ "lifeTime": { - "min": 6, - "max": 6 + "value": 6 }, "coords_system": "PARTICLE_EFFECT", @@ -97,13 +96,7 @@ "scale": { - "interpolation": "DISCRETE", - "timeline": - [ - { - "value": [ 20, 7.12 ] - } - ] + "value": [ 20, 7.12 ] }, "color": diff --git a/assets/effects/sine-sparks.json b/assets/effects/sine-sparks.json index 0f1686b..a4f7657 100755 --- a/assets/effects/sine-sparks.json +++ b/assets/effects/sine-sparks.json @@ -38,8 +38,7 @@ "lifeTime": { - "min": 6, - "max": 6 + "value": 6 }, "coords_system": "PARTICLE_EFFECT", @@ -97,13 +96,7 @@ "scale": { - "interpolation": "DISCRETE", - "timeline": - [ - { - "value": [ 10, 10 ] - } - ] + "value": [ 10, 10 ] }, "color": diff --git a/assets/effects/sparkler-looped.json b/assets/effects/sparkler-looped.json new file mode 100755 index 0000000..2096bf0 --- /dev/null +++ b/assets/effects/sparkler-looped.json @@ -0,0 +1,91 @@ +{ + "name": "Simple Sparkler", + + "emitters": + [ + { + "name": "Spark", + + "maxParticles": 2000, + "preloading": 2000, + "texturePath": "textures/spark-white.png", + + "hasInertion": "false", + "gravity": [0, 0, 0], + + "spawnRange_system": "PARTICLE_EFFECT", + + "spawnTotal": + { + "interpolation": "CUBIC_SPLINE", + "timelineType": "LOOPED", + "timeline": + [ + { + "t": 0.000, + "value": 0 + }, + { + "t": 0.001, + "value": 0 + }, + { + "t": 9.999, + "value": 10000 + }, + { + "t": 10.000, + "value": 10000 + } + ] + }, + + "spawnRange": + { + "value": [ 0, 0, 0, 360 ] + }, + + "lifeTime": + { + "min": 0.1, + "max": 1 + }, + + "coords_system": "PARTICLE_BIRTH", + "coords_axis_system": "PARTICLE_BIRTH", + "rotation_system": "PARTICLE_EFFECT", + + "coords": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 0, 0 ] + }, + { + "t": 1, + "min": [ 300, 0, 0 ], + "max": [ 600, 0, 0 ] + } + ] + }, + + "rotation": + { + "value": [ 0, 0, 0 ] + }, + + "scale": + { + "value": [ 10, 10 ] + }, + + "color": + { + "value": [ 1, 1, 0, 1 ] + } + } + ] +} \ No newline at end of file diff --git a/assets/effects/sparkler.json b/assets/effects/sparkler.json index b81709c..fefb11c 100755 --- a/assets/effects/sparkler.json +++ b/assets/effects/sparkler.json @@ -71,13 +71,7 @@ "scale": { - "interpolation": "DISCRETE", - "timeline": - [ - { - "value": [ 10, 10 ] - } - ] + "value": [ 10, 10 ] }, "color": diff --git a/assets/effects/test.json b/assets/effects/test.json index 92c03cd..d7c8a00 100755 --- a/assets/effects/test.json +++ b/assets/effects/test.json @@ -1,57 +1,37 @@ { - "name": "Simple Sparkler", + "name": "Sparkler - бенгальский огонь", "emitters": [ { - "name": "Spark", + "name": "Magic Star", - "maxParticles": 1000, + "maxParticles": 10000, "preloading": 1000, - "texturePath": "textures/spark-white.png", - "hasInertion": "false", - "gravity": [0, 0, 0], + "texturePath": "textures/star-white.png", + + "gravity": [ 0, -100, 0 ], "spawnRange_system": "PARTICLE_EFFECT", "spawnTotal": { - "interpolation": "CUBIC_SPLINE", - "timelineType": "LIMITED", - "timeline": - [ - { - "t": 0.000, - "value": 0 - }, - { - "t": 0.010, - "value": 0 - }, - { - "t": 9.990, - "value": 2000 - }, - { - "t": 10.000, - "value": 2000 - } - ] + "value": 50 }, "spawnRange": { - "value": [ 0, 0, 0, 360 ] + "value": [ 0, 0, 360, 180 ] }, "lifeTime": { - "min": 0.1, - "max": 1 + "min": 10, + "max": 10 }, - "coords_system": "PARTICLE_BIRTH", + "coords_system": "PARTICLE_EFFECT", "coords_axis_system": "PARTICLE_BIRTH", "rotation_system": "PARTICLE_EFFECT", @@ -65,16 +45,33 @@ "value": [ 0, 0, 0 ] }, { - "t": 1, - "min": [ 300, 0, 0 ], - "max": [ 600, 0, 0 ] + "t": 1.000, + "min": [ 150, 0, 0 ], + "max": [ 150, 0, 0 ] } ] }, "rotation": { - "value": [ 0, 0, 0 ] + "interpolation": "LINEAR_SPLINE", + "timeOffset": + { + "min": 0, + "max": 1 + }, + "timelineType": "LOOPED", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 45, 0 ] + }, + { + "t": 1.000, + "value": [ 360, 45, 0 ] + } + ] }, "scale": @@ -90,7 +87,181 @@ "color": { - "value": [ 1, 1, 0, 1 ] + "value": [ 0, 1, 0, 1 ] + } + }, + { + "name": "Magic Star", + + "maxParticles": 10000, + "preloading": 1000, + + "texturePath": "textures/circle-white.png", + + "gravity": [ 0, -100, 0 ], + + "spawnRange_system": "PARTICLE_EFFECT", + + "spawnTotal": + { + "value": 50 + }, + + "spawnRange": + { + "value": [ 0, 0, 360, 180 ] + }, + + "lifeTime": + { + "min": 10, + "max": 10 + }, + + "coords_system": "PARTICLE_EFFECT", + "coords_axis_system": "PARTICLE_BIRTH", + "rotation_system": "PARTICLE_EFFECT", + + "coords": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 0, 0 ] + }, + { + "t": 1.000, + "min": [ 150, 0, 0 ], + "max": [ 150, 0, 0 ] + } + ] + }, + + "rotation": + { + "interpolation": "LINEAR_SPLINE", + "timeOffset": + { + "min": 0, + "max": 1 + }, + "timelineType": "LOOPED", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 45, 0 ] + }, + { + "t": 1.000, + "value": [ 360, 45, 0 ] + } + ] + }, + + "scale": + { + "interpolation": "DISCRETE", + "timeline": + [ + { + "value": [ 10, 10 ] + } + ] + }, + + "color": + { + "value": [ 1, 0, 0, 1 ] + } + }, + { + "name": "Magic Star", + + "maxParticles": 10000, + "preloading": 1000, + + "texturePath": "textures/rect-white.png", + + "gravity": [ 0, -100, 0 ], + + "spawnRange_system": "PARTICLE_EFFECT", + + "spawnTotal": + { + "value": 50 + }, + + "spawnRange": + { + "value": [ 0, 0, 360, 180 ] + }, + + "lifeTime": + { + "min": 10, + "max": 10 + }, + + "coords_system": "PARTICLE_EFFECT", + "coords_axis_system": "PARTICLE_BIRTH", + "rotation_system": "PARTICLE_EFFECT", + + "coords": + { + "interpolation": "LINEAR_SPLINE", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 0, 0 ] + }, + { + "t": 1.000, + "min": [ 150, 0, 0 ], + "max": [ 150, 0, 0 ] + } + ] + }, + + "rotation": + { + "interpolation": "LINEAR_SPLINE", + "timeOffset": + { + "min": 0, + "max": 1 + }, + "timelineType": "LOOPED", + "timeline": + [ + { + "t": 0.000, + "value": [ 0, 45, 0 ] + }, + { + "t": 1.000, + "value": [ 360, 45, 0 ] + } + ] + }, + + "scale": + { + "interpolation": "DISCRETE", + "timeline": + [ + { + "value": [ 10, 10 ] + } + ] + }, + + "color": + { + "value": [ 0, 0, 1, 1 ] } } ] diff --git a/assets/textures/circle-white.png b/assets/textures/circle-white.png new file mode 100755 index 0000000000000000000000000000000000000000..d3eb9a9cd3a040d85cb05524afe70a8677e40f67 GIT binary patch literal 2589 zcmds(eNfVQ9>*b6%+%VkOV55iUVCa9Sl3Sc#?nlST+;-6Dg!aM2YV3xCBcdUE4Nu= z;Y}CNR-+lK@=$4yx*&oz#T|6Dn?I_X7NMA5ZNCcSHV(oE&i=UQW~ZIGx&Q8u&wS_e zn(uu7_{{h7e!q_tMGMlpNpz#gEI*I_Q+1zt=w zA-gj3GBKD-tuw|eLZ|xaH5<1az+j?pzALPerTAhB{i{7(Acf(hLxus(N&OfIe3=?VN`G*jC5 zg?a)HnoX4U!;{+GPa*h(o9E#SXCsQLr~Q83o>2(?zEind9Irrj@3Bu^lAg}?31 zX$WSC)UdZRBZ<5}tVHeFL=l_p)gJ2$GKdPAx?yj(Kq8-v8R#4|B4$b;e5BZh+(#1Q zHZ-=IrH&gz3Y15`2*gHhD6ze!BK^$N7C&E>WW3e%cbGGf4H9PGQ4K!7Cvz+wdWC8y z>p=c$-zopyj4k2?(Sxc%?>&iwEb39aCTWOoi1{1OgrEz^m~+0%X^%mC9n2#3%wd^> z++?xPH_^ol!hPME)+%%DKZJo|&Wasi{`^rJn%|XTJc8S5HP<1eD#LZnX{D+5hEU(- z+;s{%lfrD*$dgR9=Y*AL+aaPcXWCt*HeLfHOeb|a_xuE%S!j=Em*12+?AV8@w7Hi7 zd~`qA`nU!m)fm>GBZrcWnK)+=XH_8>9XEPZqpvX48ic#xi71*_6uMgNtT_w;iS~Ky z)*hK-E!L&rHRu5RbZ&_iQ6r?ahB!36JlTkycDum)b}Kjtq)IizB_=l_bi)_Y8De7C zQKi%4h8mKX``CT0Qb#VfQmt*g3Y3SR%(A*F5#Krkfbth48=G;@sGRYQU^TZ` z_mB{@t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m-F7^@0z4!y({gjB$T$4h06jt7sOGo-~3*J6!T4w5J}z9jSk(s{hQ z(%Grq{0$xIS$QnsK*{?lm>}W}p4*zEN8r2VKDXTX*5Pa2Wn~<`{Z&(Xa)?@PE7mHZtb0(0Nif3AlyWn4i z+s_MT+KoHm?x=EnCDjt3{~{cSQsO>ONnnagEyd5oo&=dC%}XcWHyo44*PYVs#diSo zYtM@+Ov?Z5)hv0sW4IAOziQ`4VHiMW@$BB5kPi4uNhZ{rXWsQ+fgig!-<-&~sbu#S z{3n2Qb#iNjpo;_i@)$z?}d$84B_9YJk)&4fLJ zx)f}o+P}hX-8eM*QK$tJC|dh}+GMZ)>N^Uz7hBD~csNQdsiZ(w2vf2D!z=#++H6k> literal 0 HcmV?d00001 diff --git a/game/main_code.cpp b/game/main_code.cpp index 6f779e0..37834a2 100644 --- a/game/main_code.cpp +++ b/game/main_code.cpp @@ -66,20 +66,14 @@ void TMyApplication::InnerDeinit() { } -bool ignoreMove = false; - void TMyApplication::InnerOnMouseDown(TMouseState& mouseState) { - ignoreMove = false; - if (mouseState.LeftButtonPressed) { sparkler.setCoords({ (float)mouseState.X, Renderer->GetScreenHeight() - (float)mouseState.Y, 0 }); } - else if (mouseState.RightButtonPressed) + if (mouseState.RightButtonPressed) { - ignoreMove = true; - if (sparkler.isSpawning()) { sparkler.stopSpawn(); @@ -91,14 +85,12 @@ void TMyApplication::InnerOnMouseDown(TMouseState& mouseState) } } -void TMyApplication::InnerOnMove(Vector2f p, Vector2f shift) +void TMyApplication::InnerOnMouseMove(TMouseState& mouseState) { - if (ignoreMove) + if (mouseState.LeftButtonPressed) { - return; + sparkler.setCoords({ (float)mouseState.X, Renderer->GetScreenHeight() - (float)mouseState.Y, 0 }); } - - sparkler.setCoords({ p[0], p[1], 0 }); } void TMyApplication::InnerDraw() diff --git a/game/main_code.h b/game/main_code.h index f63dd5f..ac46252 100644 --- a/game/main_code.h +++ b/game/main_code.h @@ -54,7 +54,7 @@ public: virtual void InnerOnMouseDown(TMouseState& mouseState); - virtual void InnerOnMove(Vector2f p, Vector2f shift); + virtual void InnerOnMouseMove(TMouseState& mouseState); };