Obi Official Forum
Help Get rope/rod stretch lengh? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Get rope/rod stretch lengh? (/thread-2773.html)



Get rope/rod stretch lengh? - JhonatasFarias - 27-02-2021

Hi there, is there a way i can identify/get the lenght of a rope or rod via script?

i mean like in stationary pose it is about 100% long... then streching it i see it's something like 120% long from initial pose... or initial pose is 1m then streching it's about 1.2m... 1.3m...


RE: Get rope/rod stretch lengh? - josemendez - 28-02-2021

(27-02-2021, 07:59 PM)JhonatasFarias Wrote: Hi there, is there a way i can identify/get the lenght of a rope or rod via script?

i mean like in stationary pose it is about 100% long... then streching it i see it's something like 120% long from initial pose... or initial pose is 1m then streching it's about 1.2m... 1.3m...

You can get both the rest length (stationary length, 100% in your example)
Code:
float restLength = rope.restLength;

And the current length (including any stretching, 1.2, 1.3, etc):
Code:
float length = rope.CalculateLength();

The ratio between both (length/restLength) gives you a measure of strain: <1 if the rope is compressed, ==1 if the rope remains at rest length, > 1 if the rope is stretched.


RE: Get rope/rod stretch lengh? - JhonatasFarias - 01-03-2021

(28-02-2021, 07:29 PM)josemendez Wrote: You can get both the rest length (stationary length, 100% in your example)
Code:
float restLength = rope.restLength;

And the current length (including any stretching, 1.2, 1.3, etc):
Code:
float length = rope.CalculateLength();

The ratio between both (length/restLength) gives you a measure of strain: <1 if the rope is compressed, ==1 if the rope remains at rest length, > 1 if the rope is stretched.

Thanks! Sonrisa