Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Crashes when invMasses is set to zero
#1
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();
Reply


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