Hello Collodium;
I was using your elastic particle demo (see below for exact code) and I thought I would see what happens when the elastic particle group loses elasticity and melts and then regains it. This works fine for one group (just "tag" or "tag2") and its fun to watch it jump back together.
However when I do both at once it freezes and sends this message (see below) to the console.
thanks for your time.
yours
winkr7
+ System: On start of layout
-> ctrl: LFJS World: fixed step rate
-> ctrl: LFJS Set World Step 30 steps/sec FPS
-> ctrl: LFJS Set particle as the particle object
// The Elastic or Spring flags needs to be set before spawn otherwise they cannot be set later.
When the particles are created they are bound to their neighbors.
// This is all the Liquidfun documentation says about Elastic particles:
Elastic particles deform and may also bounce when they collide with rigid bodies.
From the cpp code, Elastic particles are connected in triads, or 3s.
-> ctrl: LFJS Turn Spring behavior OFF for spawning
-> ctrl: LFJS Turn Elastic behavior ON for spawning
-> ctrl: LFJS Particle group "tag" Rigid: ON
-> ctrl: LFJS Particle system elastic strength: 100
-> ctrl: LFJS Particle system spring strength: 100
-> ctrl: LFJS Set spawn color to rgba(250,140,30,255)
-> ctrl: LFJS Create particle "tag", shape box at 160, 300, width 200, height 200, angle 0
// This is what the documentation says about Spring particles:
Spring particles produce the effect of being attached to one another, as by a
spring. Particles are "connected" in pairs. Each particle is connected to the
one that was closest to it at time of creation. Once paired, particles do not
change "partners." The farther an external force pulls them from one another,
the greater the power with which they collide when that external force is
removed. No matter how far particles get from one another, the connection
between them does not "snap."
-> ctrl: LFJS Turn Spring behavior ON for spawning
-> ctrl: LFJS Turn Elastic behavior OFF for spawning
-> ctrl: LFJS Set spawn color to rgba(100,220,60,255)
-> ctrl: LFJS Create particle "tag2", shape box at 440, 300, width 200, height 200, angle 0
----+ (no conditions)
-----> System: Wait 4 seconds
--------+ (no conditions)
---------> ctrl: LFJS Group "tag" all particles set Elastic behavior OFF
---------> ctrl: LFJS Group "tag2" all particles set Spring behavior OFF
---------> System: Wait 4 seconds
---------> ctrl: LFJS Group "tag" all particles set Elastic behavior ON
---------> ctrl: LFJS Group "tag2" all particles set Spring behavior ON
// here is the freeze this is the console text :
dd5c0979-a104-4195-9e94-a6b37ce18f4c:1 Uncaught (in promise) RuntimeError: float unrepresentable in integer range
at wasm-function[475]:0x239ac
at wasm-function[514]:0x2b3cd
at wasm-function[559]:0x36193
at wasm-function[445]:0x20694
at wasm-function[94]:0x54b3
at _0x5bebeb.<computed> (blob:https://preview.construct.net/dd5c0979-a104-4195-9e94-a6b37ce18f4c:1:75982)
at _0x49a3a9.<computed>.Step (blob:https://preview.construct.net/dd5c0979-a104-4195-9e94-a6b37ce18f4c:1:131885)
at LFJSInstance.Tick (blob:https://preview.construct.net/7381ba8a-306d-4a33-abc7-1ceb43f5b5d1:2360:26)
at C3.Runtime._BehaviorTick (https://editor.construct.net/r171-3/preview/c3/runtime.js:1:25340)
at C3.Runtime.Step (https://editor.construct.net/r171-3/preview/c3/runtime.js:1:26912)