Obi Official Forum

Full Version: Is it possible to add force to specific particles on a rope?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to add force to specific particles on a rope? For example I have a rope which the head and tail is fixed ( by using ObiParticleAttachment) , and I want the middle part of the rope can bounce by specific force. Not sure is it possible because I can't find the related API.  Or  can we use the  pin constrains to reach a similar effect ?
(06-06-2020, 10:15 PM)wenzy Wrote: [ -> ]Is it possible to add force to specific particles on a rope? For example I have a rope which the head and tail is fixed ( by using ObiParticleAttachment) , and I want the middle part of the rope can bounce by specific force. Not sure is it possible because I can't find the related API.  Or  can we use the  pin constrains to reach a similar effect ?

Hi Wenzy,

Yes, you can add external forces to specific particles. The solver has a "externalForces" array, just like int has "positions", "velocities", etc. Each entry in the array is the external force applied to that particle.

You can find all available per-particle arrays in the API docs for the ObiSolver class.

You can take the ObiAmbientForceZone class as reference on how to set external forces.