I'm reading some information about liquidFun and this script has "
b2DestructionListener"
When I was checking gideros source
"Line 73""Line 484"functions
virtual void SayGoodbye (b2ParticleGroup *group)
virtual void SayGoodbye (b2ParticleSystem *particleSystem, int32 index)
virtual bool ShouldCollide (b2Fixture *fixture, b2ParticleSystem *particleSystem, int32 particleIndex)
virtual bool ShouldCollide (b2ParticleSystem *particleSystem, int32 particleIndexA, int32 particleIndexB) |
don't exist, but you can call it with Flags (
this functionality is ready on gideros "Line 31")
--b2.ParticleSystem.FLAG_PARTICLE_CONTACT_FILTER = 2^17
--b2.ParticleSystem.FLAG_FIXTURE_CONTACT_FILTER = 2^16
--b2.ParticleSystem.FLAG_PARTICLE_CONTACT_LISTENER = 2^15 --EXPENSIVE
--b2.ParticleSystem.FLAG_FIXTURE_CONTACT_LISTENER = 2^14 --EXPENSIVE
--b2.ParticleSystem.FLAG_REPULSIVE = 2^13 = 8192 --With high repulsive force.
--b2.ParticleSystem.FLAG_REACTIVE = 2^12 = 4096 --Makes pairs or triads with other particles.
--b2.ParticleSystem.FLAG_STATIC_PRESSURE = 2^11 = 2048 --Less compressibility.
--b2.ParticleSystem.FLAG_BARRIER = 2^10 = 1024 --Prevents other particles from leaking.
--b2.ParticleSystem.FLAG_DESTRUCTION_LISTENER = 2^9 = 512 --Call b2DestructionListener on destruction.
--b2.ParticleSystem.FLAG_COLOR_MIXING = 2^8 = 256 --Mix color between contacting particles.
--b2.ParticleSystem.FLAG_TENSILE = 2^7 = 128 --like a ocean, scum
--b2.ParticleSystem.FLAG_POWDER = 2^6 = 64 --like a boiled // Without isotropic pressure.
--b2.ParticleSystem.FLAG_VISCOUS = 2^5 = 32 --like a rice
--b2.ParticleSystem.FLAG_ELASTIC = 2^4 = 16 --stable jelly (if on the world doesn't exist strength)
--b2.ParticleSystem.FLAG_SPRING = 2^3 = 8 --really jelly
--b2.ParticleSystem.FLAG_WALL = 2^2 = 4 --like a sponge or water drops on surface // Zero velocity
--(it only works with two Particles group like
--minium but another particles group must have different Flag)
--b2.ParticleSystem.FLAG_ZOMBIE = 2^1 = 2 --Removed after next simulation step.
--b2.ParticleSystem.FLAG_WATER = 0 --water |
Sample: b2.ParticleSystem.FLAG_COLOR_MIXING | b2.ParticleSystem.FLAG_WALL
The particle type. Can be combined with the | operatorIt would be interesting than we have
b2ContactFilter -Line 99-
as event
Read more information here) so when we'll use lifespan, we can do something in that event specific
Comments
Event.BEGIN_CONTACT_PARTICLE
and here too
see lines from 346 to 422
I Tried the next code
As I said in my first post better are
b2.ParticleSystem.FLAG_PARTICLE_CONTACT_FILTER = 2^17
b2.ParticleSystem.FLAG_FIXTURE_CONTACT_FILTER = 2^16
But these functions are not yet available on Gideros I don't know if core team will implementation these function
On another hand something had tried Event.BEGIN_CONTACT_PARTICLE 'cos it doesn't work for me but maybe I'm doing It Wrong
[-] Liasoft
https://deluxepixel.com
On the other hand, How Can I test these changes? How Can I know if I'm on the right way? :-/
I remember asking these matters when Gideros changed to open source, but nobody told me how to create the installation files if you changed something on the source code...
Currently Does exist some tutorial for it?
[-] Liasoft
Also neither of them get e.system, even though it looks like it's pushed to Lua by Gideros. On lines 488-489 here..
https://github.com/gideros/gideros/blob/master/luabinding/box2dbinder2.cpp
... and getb2 looks like it's working for world and fixture, but not the particle system.
Here I posted this problem: http://giderosmobile.com/forum/discussion/7061/liquid-fun#Item_2
So I haven't took this matter again because I wanted make levels puzzles more big so it is a limitation for me.
Dirty solution is create liquid in default position (when camera is (0,0)) and without move the camera but if you want to follow liquid with the camera you can't do.
[-] Liasoft