02-03-2022, 05:26 PM
(This post was last modified: 02-03-2022, 05:31 PM by josemendez.)
(02-03-2022, 05:02 PM)lufydad Wrote: Thank you a lot it seems to work, with the code you give (it's just "particleGroup" and not "ParticleGroup", at least for my version of ObiRope). But, I don't understand what does the function Bind() add to your code ?
An attachments makes sure the position of a particle stays fixed relative to the attached object. Without them, particle and object would move independently.
To do this, the attachment stores a "reference pose" so to speak, which is nothing more than the position the particle is in when you call Bind(). Each frame, the attachment makes sure to keep the relative position the particle and the object were in at the time of calling Bind(). For instance if you call Bind() when the particle is 3 units to the left of the object, the attachment will make sure that from that point on the particle is always 3 units left of the object as the simulation progresses.
If you didn't call Bind() after setting the position of the particle, the attachment would immediately revert the particle back to the position where it was last time Bind() was called.
This is all very similar to how character mesh skinning works in all programs: you create a mesh, create a skeleton for it, then bind the mesh to the skeleton. If at some point you want to change the topology of the mesh, you need to re-bind it to the skeleton to generate a new "bind pose".