Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to space rope particles identically?
#1
Hi, I was hoping I could please get some assistance: how can I force the distances between each particle and the next to all be be identical?

Details: I suspect that what I actually want is for the "restLengths" and/or the distance-constraints of all elements in the rope to be identical; however, there is some slight variation, enough to be problematic for what I'm doing. My rope BluePrint is fairly long, is a closed loop, and the "Resolution" is set to 1; if I open the asset in a text editor, I can see that the slight differences in the "restLengths". Also, I'm using the chain-renderer, and the variation in the spacing of chain links is visible. Help would be appreciated, thanks in advance!

Chris
Reply
#2
(19-05-2022, 08:54 PM)cts1978 Wrote: Hi, I was hoping I could please get some assistance: how can I force the distances between each particle and the next to all be be identical?

Details: I suspect that what I actually want is for the "restLengths" and/or the distance-constraints of all elements in the rope to be identical; however, there is some slight variation, enough to be problematic for what I'm doing. My rope BluePrint is fairly long, is a closed loop, and the "Resolution" is set to 1; if I open the asset in a text editor, I can see that the slight differences in the "restLengths". Also, I'm using the chain-renderer, and the variation in the spacing of chain links is visible. Help would be appreciated, thanks in advance!

Chris

Hi!

Inter-particle distances aren't identical because each blueprint control point must coincide exactly with one particle. Since the length of each curve segment isn't guaranteed to be a multiple of the inter-particle distance, the remainder is distributed between all particles in that segment.

You can however force the restLengths in your distance constraints to a specific value, like you mention. It's possible to do this either in the blueprint right before instantiating the rope, or do it in the rope once it's been instantiated.

The manual contains some sample code to deal with constraints at runtime:
http://obi.virtualmethodstudio.com/manua...aints.html

Simply iterate trough all distance constraint batches, setting their restLengths to your desired value.

Let me know if you need further help,
Reply