16-01-2024, 08:41 AM
(This post was last modified: 16-01-2024, 08:42 AM by josemendez.)
(08-01-2024, 03:53 PM)Alexander34 Wrote: I want to copy all positions of the previous rope to the one we are going to turn on. As far as I know, the positions are accessed via solver.positions, but if I understand correctly, these are the positions of both ropes being simulated.
Hi!
Assuming both ropes have the same amount of particles, it's just a matter of iterating trough their elements copying particle positions as you go. Each element points to the correct indices in solver.positions for the current rope. See: http://obi.virtualmethodstudio.com/manua...ropes.html
If they have different amounts of particles, then things get considerably more complex as you need to decide whether to remove excess particles from one rope, add extra particles to the other one, where to remove/add particles from/to, connect them using new constraints, etc. Most of this can be handled automatically using a ObiRopeCursor, however it works in terms of length - instead of particles - so it would also require some non trivial work.
(08-01-2024, 03:53 PM)Alexander34 Wrote: I don't want to use the ObiParticleRenderer solution,
Not sure what you mean, sorry. All ObiParticleRenderer does is render the particles so that you can visualize them: it doesn't copy particles, duplicate the rope or anything similar?