Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi Fluid flicker after setting particles life to 0
#6
(20-07-2022, 03:06 PM)CumaliSAH1N Wrote: This is the code I'm using to kill the particles (some of the code is omitted for clarity).

All of my emitter's minpoolsize is set to 1

Code:
int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 0);

Vector3 position = hitPointTransform.position;
QueryShape query = new QueryShape(QueryShape.QueryType.Sphere, Vector3.zero, Vector3.zero, 0,
    fluidCastRadius, filter);
AffineTransform affineTransform = new AffineTransform(position, Quaternion.identity, Vector4.one);

QueryResult[] results = obiSolver.SpatialQuery(query, affineTransform);
int length = results.Length;

for (int i = 0; i < length; i++)
{
    int particleIndex = obiSolver.simplices[results[i].simplexIndex];
    ObiSolver.ParticleInActor actor = obiSolver.particleToActor[particleIndex];
    ObiEmitter emitter = actor.actor as ObiEmitter;

    emitter.life[actor.indexInActor] = 0.0f;
}

Hi,

Your code looks fine to me. Will try to reproduce this issue and get back to you.
Reply


Messages In This Thread
RE: Obi Fluid flicker after setting particles life to 0 - by josemendez - 20-07-2022, 03:13 PM