12-08-2019, 11:00 AM
(This post was last modified: 12-08-2019, 11:07 AM by josemendez.)
(10-08-2019, 12:36 AM)MasterGeneralB Wrote: 1) The gravity variable in the obi solver, is there a way to reference it in a script so as to modify its value (I checked and it seems this isnt the unity physics engines value for gravity, so am i correct in assuming its the obi solvers own?). Having blobs converge back on each other could then be done by getting either the largest blobs position as the center of gravity and ramping the strength of the field towards it (esentially making all the smaller blobs "fall" towards it) or an average center of all blobs as the center of the gravitational pull and doing the same.
To modify gravity, just do:
Code:
solver.parameters.gravity = <your gravity>
solver.UpdateParameters();
But keep in mind that gravity is not spatially-variable, not a vector field. You're talking about having smaller blobs fall towards the bigger one, you can only accomplish this using per-particle external forces, since gravity is the same for all particles in the solver.
Code:
solver.externalForces[emitter.particleIndices[i]] = <your external force>
I'd simply calculate the center of mass of all particles, then apply an acceleration proportional to their distance to it. Since the largest blob is also the heaviest one, the center of mass will always be relatively close to it. No need to identify individual blobs.
Quote:2) Is there any way of identifying the edge perimeter of a liquid "blob" or are all the particles uninformed of their respective position relative to the body of fluid as a whole?
Nope, no way to do that. All particles behave in exactly the same way and do not know anything about the fluid as a whole. This helps a lot with multithreading as we can perform the exact same operations on each particle, independently of all others, no potential race conditions.
Quote:3) In my mild experimentation i have managed to break obi fluids, Im getting a "mesh 'particle imposters' abnormal mesh bounds - most likely it has some invalid"...
message. Im using a modified grabber (uses multiple grabbed particles in a given 2d circle rather than one grabbed particle) and moves them around on screen. Any idea why this error shows up, or more info is needed on my parameters?
Without seeing your code, it's close to impossible to tell why is this happening.
Quote:EDIT: so looking through the manual more, there must be some value/info on the fluid boundary since atmo drag makes uee of it...
Nope, atmospheric drag works by modifying the particle's speed using the norm of the gradient of the density field. This is a continuous quantity that happens to be larger for particles closer to the surface, however no classification of particles takes place anywhere in the code (no binary surface/not surface flag or anything).