Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy ropes in play mode
#2
(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?
Reply


Messages In This Thread
Copy ropes in play mode - by Alexander34 - 08-01-2024, 03:53 PM
RE: Copy ropes in play mode - by josemendez - 16-01-2024, 08:41 AM
RE: Copy ropes in play mode - by Alexander34 - 16-01-2024, 02:47 PM
RE: Copy ropes in play mode - by josemendez - 16-01-2024, 07:42 PM
RE: Copy ropes in play mode - by Alexander34 - 16-01-2024, 08:08 PM
RE: Copy ropes in play mode - by josemendez - 17-01-2024, 11:08 AM