Obi Official Forum

Full Version: fluid collisions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In my case the player "water droplet" is moving on platform and collecting other droplets. But we are changing ground rotation to move our droplet. 

The problem1:
Only the player water droplet should move when i changing ground rotation.

The solution1:
I am using different "CollisionMaterials". In my player water droplet have "High Friction" other droplets have "Low Friction".

The problem2:
When I collect other droplets, other droplet Collision Material should change to "High Friction" reason of together move. But i couldnt use particle collision. How i can get the collision debug with in 2 emitter fluid?
(24-05-2022, 07:23 AM)sinannsekerr Wrote: [ -> ]In my case the player "water droplet" is moving on platform and collecting other droplets. But we are changing ground rotation to move our droplet. 

The problem1:
Only the player water droplet should move when i changing ground rotation.

The solution1:
I am using different "CollisionMaterials". In my player water droplet have "High Friction" other droplets have "Low Friction".

The problem2:
When I collect other droplets, other droplet Collision Material should change to "High Friction" reason of together move. But i couldnt use particle collision. How i can get the collision debug with in 2 emitter fluid?

Hi!

If I understood correctly, you want to assign Collision Materials individually to each particle, regardless of the emitter component they're part of. Correct?

This isn't currently supported, as it would require each particle to have its own friction, stickiness, etc. greatly increasing memory usage. Collision Materials can only be specified on a per-actor basis, all particles in each actor reference the same material.

kind regards,
In video, i am controlling the ground for move player.

When i touch the droplet, droplet's dynamic friction has to be 1 to move with my player. How should i do this? Thanks for answer!

https://www.youtube.com/watch?v=GAQpd_cNc5k
(24-05-2022, 09:08 AM)sinannsekerr Wrote: [ -> ]In video, i am controlling the ground for move player.

When i touch the droplet, droplet's dynamic friction has to be 1 to move with my player. How should i do this? Thanks for answer!

You cannot have different friction coefficients for particles that belong to the same emitter.

However, even if your droplets are part of different emitters fluid particles do not collide with each other as warned in the manual:

Quote:Please note that fluid particles do not collide with each other, only granulars (gravel, pebbles) do. Fluid particles interact with each other trough density constraints, so there will be no contacts between fluid particles reported by the solver. With fluids, you can use advection or diffusion instead to get information about a particle's neighborhood.

If fluid particles would collide, they would behave like solids instead. Fluids interact trough density constraints, and the only way particles can exchange information with each another is trough diffusion.

You will need to rethink how to implement your use case, since there's no concept of "droplet" in Obi: you cannot directly detect when two droplets collide or interact with each other, and each droplet cannot have different friction coefficients. There's no concept of "wave" or "splash" either, these structures automatically emerge from the particle-based simulation.
Can you send me a script example, about 2 fluid collision debug? Really need help about it, i am stuck.


I have 1 solver and 2 emitter in it.

Need to know when 2 emitter meet...
(24-05-2022, 02:53 PM)sinannsekerr Wrote: [ -> ]Can you send me a script example, about 2 fluid collision debug?  Really need help about it, i am stuck.

Hi!

As I just explained in the previous message, fluids do not collide with each other. There's no such thing as "fluid collision debug". There's only one way to indirectly determine if fluid particles are within interaction range, and that's using diffusion.

(24-05-2022, 02:53 PM)sinannsekerr Wrote: [ -> ]I have 1 solver and 2 emitter in it.
Need to know when 2 emitter meet...

There's no out-of-the-box way to know this in Obi. Each individual fluid particle interacts with many particles around it (often +50), but it doesn't care what emitters they belong to since each particle carries its own data. You need to figure out a different approach to this.

Let's assume your fluid is conceptualized into "drops", and you want to know when two drops merge with each other. First, you need to be able to identify individual drops in the fluid and roughly determine their position and radius. To do this you can analyze particle positions, which you can retrieve using the particle API: http://obi.virtualmethodstudio.com/manua...icles.html

One way to do this is using a greedy island-building algorithm:
- Initially, each particle belongs to its own "drop" with radius == the radius of the particle, and position == the position of the particle.
- Iterate trough all particles: for each one, get particles close to the drop they belong to, then merge them into a single drop updating the drop's position to be the average of all the particles in it, and the radius to be the maximum distance from any particle in the drop to the drop's center.
- Once you're done iterating trough all particles, the result is a list of all drops: about each drop you know its position, its radius, and the list of particles in it.

If you keep a list of all drops over a few frames, you can identify drops that have merged or drops that have split into multiple smaller drops, which is what you are looking for I believe.
Thank you for answer!