Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Crashes when invMasses is set to zero
#2
(23-04-2021, 10:55 AM)momns Wrote: Please excuse my English!

I need to stop the fluid from moving (I don't want it to flow any more).
I stop the movement of the fluid by doing the following



Code:
for (int i = 0; i < emitter.solverIndices.Length; ++i){
            int solverIndex = emitter.solverIndices[i];
            float invMass = emitter.solver.invMasses[solverIndex];
            emitter.solver.invMasses[solverIndex] = 0;
}





However, when I run this code, the fluid display disappears and a crash occurs.

The error is as follows

What are the possible causes?



Code:
Converting invalid MinMaxAABB
UnityEngine.Mesh:SetVertices (System.Collections.Generic.List`1<UnityEngine.Vector3>)
Obi.ParticleImpostorRendering:Apply (UnityEngine.Mesh) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:39)
Obi.ParticleImpostorRendering:UpdateMeshes (Obi.IObiParticleCollection) (at Assets/Obi/Scripts/Common/Rendering/ParticleImpostorRendering.cs:150)
Obi.ObiParticleRenderer:DrawParticles (Obi.ObiActor) (at Assets/Obi/Scripts/Common/Rendering/ObiParticleRenderer.cs:80)
Obi.ObiActor:Interpolate () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:1189)
Obi.ObiSolver:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1622)
Obi.ObiUpdater:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:110)
Obi.ObiFixedUpdater:Update () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:62)

Mesh 'Particle impostors': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
Mesh bounds min=(nan, nan, nan), max=(nan, nan, nan). Please make sure the mesh is exported without any errors.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)



And I saw in another thread that you also need the following code to stop the fluid.

It seems that solver does not have UpdateParameters in the current version.



Code:
emitter.solver.distanceConstraintParameters.enabled = false;
emitter.solver.UpdateParameters();

Hi there,

Setting the inverse mass to zero (that is, infinite mass) on a fluid would causes infinite pressure to be applied. Obi check for this and freezes the particle in place, it shouldn't crash though. Can you share the editor crash log?

The proper way to do this is to convert the particle to a granular before giving it infinite mass. See:
http://obi.virtualmethodstudio.com/forum...-2849.html
Reply


Messages In This Thread
Crashes when invMasses is set to zero - by momns - 23-04-2021, 10:55 AM
RE: Crashes when invMasses is set to zero - by josemendez - 23-04-2021, 11:03 AM