20-07-2022, 03:13 PM
(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.