Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clamping rope length
#1
Hi, is there any way to limit active rope length? I can acces the restlength but the rope can get longer than it. 
So is there any way that i can control how long the rope can get (from code) ?
I can see how long it gets from rope.CalculateLength, but i want to control it as well.
Reply
#2
Hi!

(29-06-2022, 01:12 PM)charlotte Wrote: I can acces the restlength but the rope can get longer than it. 

I'm not sure I  understand your question...unless you change the rope's rest length (by calling cursor.ChangeLength), given sufficient substeps the rope will not stretch past its rest length. That's basically what a rope simulation does: it tries to keep length constant.

You can see an in-depth explanation of how the simulation works internally and how substeps/iterations affect its quality here:
http://obi.virtualmethodstudio.com/manua...gence.html

(29-06-2022, 01:12 PM)charlotte Wrote: So is there any way that i can control how long the rope can get (from code) ?

Ropes cannot get longer than their rest length. Only situation where this can happen is if there's some external constraint forcing them to stretch (for instance if you attach both ends to kinematic objects and then separate the objects).

kind regards,
Reply
#3
(29-06-2022, 01:46 PM)josemendez Wrote: Hi!


I'm not sure I  understand your question...unless you change the rope's rest length (by calling cursor.ChangeLength), given sufficient substeps the rope will not stretch past its rest length. That's basically what a rope simulation does: it tries to keep length constant.

You can see an in-depth explanation of how the simulation works internally and how substeps/iterations affect its quality here:
http://obi.virtualmethodstudio.com/manua...gence.html


Ropes cannot get longer than their rest length. Only situation where this can happen is if there's some external constraint forcing them to stretch (for instance if you attach both ends to kinematic objects and then separate the objects).

kind regards,

"if you attach both ends to kinematic objects and then separate the objects" thats actually my situation. Can i limit the length from stretch settings?
Reply
#4
(29-06-2022, 02:04 PM)charlotte Wrote: "if you attach both ends to kinematic objects and then separate the objects" thats actually my situation. Can i limit the length from stretch settings?

That’s simply impossible to do: how would you keep a 2 meter long rope attached to two immobile objects that are 3 meters apart from each other, without it stretching (or breaking)?

There’s only two options: either the rope stretches (if you’re using kinematic objects and/or static attachments) or the rope applies forces which prevents the objects from separating (if you’re using non-kinematic rigidbodies with dynamic attachments).

If your objects are kinematic or not rigidbodies at all, they’re immobile as far as physics are concerned (cannot receive or react to forces) so the rope can’t keep them from separating and has no other option but to stretch.

cheers,
Reply