filter Collision of liquidFun

i want to make a plane that throws water , but the problem is that the water applies a force againts my plane so its more difficult to control it

I want to make the plane filter the collision of the water , but i dont know how to do it

Thanks

Hi David,

You’ll need to provide more information and some code for the community or staff to help you. We don’t know how you’ve set up your objects, physics, or anything else, so it’s difficult to give advice.

Thanks,

Brent

Well actualy what i want is to avoid collision between particleSystem and other bodies 

like a water particleSystem avoid to collide with a box

i want to know if there is a way to add catergoryBits, masBits or groupIndex to avoid collisions 

as we do for a simple body like this

local redCollisionFilter = { categoryBits=2, maskBits=3 } local redSquare = display.newRect( 0, 80, 40, 40 ) redSquare:setFillColor( 1, 0, 0 ) physics.addBody( redSquare, { friction=0, filter=redCollisionFilter } )

could be something like this ?

local FilterCollision = { categoryBits=4, maskBits=5 } testParticleSystem:createParticle( { flags = { "fixtureContactListener","tensile","colorMixing"}, velocityX = forceX \* 10, velocityY = forceY \* 10, x = parX, y = parY, lifetime = 3, filter = FilterCollision--\<\<\<\< } )

i have tried the code above but it does not work

and i have set up correctly all my physics world cause everything is working fine except of that cause i am new using liquidFun 

Hi David,

Particles in LiquidFun can’t have the same type of collision filters applied as with other physical bodies. Is your intention to have the particles pass through the box entirely, however the box might collide with other objects in the world? Would your particles collide with some objects but not others?

Brent

Yes, that’s the point   :slight_smile:

To the particles pass through the box entirely

The box that is a body , collide with other bodies except the water particles.

And the water particles to collide with other bodies except the box 

Hi David,

I’m not sure this is going to be possible. The only workaround I can think of right now is that you actually make the “box” as its own particle-based group, as created by the “:createGroup()” function. This would potentially be a rectangular group, and if possible, you might be able to set the proper flags to make it behave more like a solid object and less like a liquid, although I’m not sure that’s possible either within the scope of LiquidFun.

If you were able to achieve that setup/behavior (no guarantees), it would essentially utilize a “gotcha” in the LiquidFun system where particles will only collide with particles in the same system. Thus, the water particles in one system would collide with everything except the box, which is actually a particle group within its own system. Likewise, that box would still collide with other normal physics bodies in the world, and the water would too, but neither water nor box would collide with each other.

http://docs.coronalabs.com/api/type/ParticleSystem/createGroup.html

Brent

Hi David,

You’ll need to provide more information and some code for the community or staff to help you. We don’t know how you’ve set up your objects, physics, or anything else, so it’s difficult to give advice.

Thanks,

Brent

Well actualy what i want is to avoid collision between particleSystem and other bodies 

like a water particleSystem avoid to collide with a box

i want to know if there is a way to add catergoryBits, masBits or groupIndex to avoid collisions 

as we do for a simple body like this

local redCollisionFilter = { categoryBits=2, maskBits=3 } local redSquare = display.newRect( 0, 80, 40, 40 ) redSquare:setFillColor( 1, 0, 0 ) physics.addBody( redSquare, { friction=0, filter=redCollisionFilter } )

could be something like this ?

local FilterCollision = { categoryBits=4, maskBits=5 } testParticleSystem:createParticle( { flags = { "fixtureContactListener","tensile","colorMixing"}, velocityX = forceX \* 10, velocityY = forceY \* 10, x = parX, y = parY, lifetime = 3, filter = FilterCollision--\<\<\<\< } )

i have tried the code above but it does not work

and i have set up correctly all my physics world cause everything is working fine except of that cause i am new using liquidFun 

Hi David,

Particles in LiquidFun can’t have the same type of collision filters applied as with other physical bodies. Is your intention to have the particles pass through the box entirely, however the box might collide with other objects in the world? Would your particles collide with some objects but not others?

Brent

Yes, that’s the point   :slight_smile:

To the particles pass through the box entirely

The box that is a body , collide with other bodies except the water particles.

And the water particles to collide with other bodies except the box 

Hi David,

I’m not sure this is going to be possible. The only workaround I can think of right now is that you actually make the “box” as its own particle-based group, as created by the “:createGroup()” function. This would potentially be a rectangular group, and if possible, you might be able to set the proper flags to make it behave more like a solid object and less like a liquid, although I’m not sure that’s possible either within the scope of LiquidFun.

If you were able to achieve that setup/behavior (no guarantees), it would essentially utilize a “gotcha” in the LiquidFun system where particles will only collide with particles in the same system. Thus, the water particles in one system would collide with everything except the box, which is actually a particle group within its own system. Likewise, that box would still collide with other normal physics bodies in the world, and the water would too, but neither water nor box would collide with each other.

http://docs.coronalabs.com/api/type/ParticleSystem/createGroup.html

Brent