07-03-2018, 09:53 AM
(This post was last modified: 07-03-2018, 10:09 AM by josemendez.)
(07-03-2018, 03:26 AM)dimmduh Wrote: Bump.
Please, helpĀ
Hi,
You should uncomment the //actor.UsesCustomExternalForces ? 1 : 0; line. Most actors do not use a custom way to apply external forces, in fact as of now only cloth does (forces are applied to cloth triangles instead of particles).
Also, Oni.AddParticleExternalForce takes an array of forces (Vector4[]), one for each particle index passed in the second argument. Since you're passing all particles in the actor (actor.particleIndices) but only one force, the call will have no effect. In fact, it can potentially crash your app since the size of the array you're passing does not match the size you SAY you're passing, which will most likely cause an access violation.
If you wanted to add force to a single particle instead, you should then call it like this:
Code:
Oni.AddParticleExternalForces(actor.Solver.OniSolver,new Vector4[]{force},actor.particleIndices[index],1); //index runs from 0 to actor.particleIndices.Length