Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add external force to particular particles?
#1
I created custom class from ObiExternalForce, added my solver. But it does not work. Do you have any idea how to add external force to particular particles?

Code:
using Obi;
using UnityEngine;

public class ObiSnakeExternalForce : ObiExternalForce
{
   public float k = 100;
   public override void ApplyForcesToActor(ObiActor actor)
   {
       var force= new Vector4(0, k, 0, 1);
       force[3] = 1;//actor.UsesCustomExternalForces ? 1 : 0;
       Oni.AddParticleExternalForce(actor.Solver.OniSolver, ref force, actor.particleIndices, actor.particleIndices.Length);
   }
}
Reply


Messages In This Thread
How to add external force to particular particles? - by dimmduh - 28-02-2018, 06:09 AM