Obi Official Forum
Is it possible to add force to specific particles on a rope? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Is it possible to add force to specific particles on a rope? (/thread-2296.html)



Is it possible to add force to specific particles on a rope? - wenzy - 06-06-2020

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 ?


RE: Is it possible to add force to specific particles on a rope? - josemendez - 07-06-2020

(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.