Comments (10)
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.
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.
@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.
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.
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.
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.
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.
OK, thanks for that!
I will look into getting this working with the latest master.
from salva.
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.
This will be implemented by #13
from salva.
Related Issues (20)
- [Advice] Add MPM
- build salva3d with sampling feature breaks HOT 1
- Incorrect Poly6 gradient HOT 3
- Feature request: Adhesive properties
- Update to latest rapier/nalgebra versions HOT 3
- deleting particles panics when IISPH solver used
- deleting particles over time
- panic when removing boundary HOT 1
- bug in salva3d::sampling::shape_surface_ray_sample() with a heightfield
- SPF +all mechanism should not be used at salva.rs
- Changelog is missing
- Documentation talks about nphysics, but this package interfaces with rapier instead
- Fit new Rapier?
- Example doesn't run successfully
- Where can I find the WebAssembly port of Salva?
- Add 64bit support
- Asserts occur randomly and break the simulation
- Example package version issue HOT 2
- Can the fluid world protected by a arc mutex be shared between threads? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from salva.