GithubHelp home page GithubHelp logo

Comments (10)

sebcrozet avatar sebcrozet commented on May 31, 2024

Hi! Testing if a particle exists at a specific location isn't implemented yet on Salva, so for now testing ball-ball proximity is the only option unfortunately.

Testing if there is a collider in a specific location is possible if you are using nphysics because you can use geometrical_world.interferences_with_point. And if you are using ncollide directly, you can do collision_world.interferences_with_point.

from salva.

rezural avatar rezural commented on May 31, 2024

OK, Thanks.

Any ideas on data structures for efficient search through the particle space? Would this structure need to be updated for every particle movement? Would it be too prohibitive?

Cheers

from salva.

sebcrozet avatar sebcrozet commented on May 31, 2024

@rezural The ideal data structure would be a grid. Actually, this is what the LiquidWorld uses and maintains internally. So the ideally we would want to let the LiquidWorld tell us what particles lie in a given region of space.

Alternatively, you can maintain your own HGrid by clearing and re-adding points after each update and use HGrid::cells_intersecting_aabb to find all the particles in a given area (defined as the AABB of the particle you intend to add).

from salva.

rezural avatar rezural commented on May 31, 2024

Right,

Something like?

liquid_world.particles_within(region: Shape, isometry) -> Vec<Point3<f32>>
liquid_world.particles_within_aabb(region: Shape, isometry) -> HGrid<..> // for efficient lookup 

I can probably add this in there of you'd like to see it.

from salva.

sebcrozet avatar sebcrozet commented on May 31, 2024

The following should be enough:

liquid_world.particles_intersecting_aabb(&self, aabb: &AABB<f32>) -> Vec<Point<f32>>;

In the end we would probably need to return some identifier that allows the user to retrieve the fluid containing said particle, but since fluid/boundary addressing will change soon, I think returning Vec<Point<f32>> is a good start and will cover your use-case.

I can probably add this in there of you'd like to see it.

Yes, that would be great. Ideally, the PR should target the rapier branch.

from salva.

rezural avatar rezural commented on May 31, 2024

So the rapier branch doesnt build against rapier (with rapier, ncollide, nalgebra cloned locally).

You mentioned a salva branch on the rapier repository? I cant find that on the dimforge repo.

Otherwise I will make a pr against salva master, hopefully within a few days.

from salva.

sebcrozet avatar sebcrozet commented on May 31, 2024

You mentioned a salva branch on the rapier repository? I cant find that on the dimforge repo.

That's right, I forgot to push it. Today I pushed it and merged it to the master branch of Rapier.

In addition I merged #11 which drops nphysics to use Rapier instead. So the master branch of salva now compiles and has integration with Rapier (using the github version of Rapier until it is released at the end of this month).

from salva.

rezural avatar rezural commented on May 31, 2024

OK, thanks for that!

I will look into getting this working with the latest master.

from salva.

rezural avatar rezural commented on May 31, 2024

I'm tempted to add a particles_intersecting_aabb method to the Fluid struct, and just collect these together in the liquid world, which will probably make this easier to work in with the addressing changes.. Thoughts?

from salva.

sebcrozet avatar sebcrozet commented on May 31, 2024

This will be implemented by #13

from salva.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.