30-03-2023, 08:47 AM
(This post was last modified: 30-03-2023, 08:48 AM by josemendez.)
(30-03-2023, 08:31 AM)rohit_dhak Wrote: So If I got it right,
If the restLength = CalculateLength(), it means that the control input is applied properly, but with extra length in CalculateLength() due to stretching.
i.e. to say that the extra length is the sag length due to stretching?
Correct. This is usually useful to calculate strain (deformation due to forces), which is the ratio between the calculated length and the rest length.
Code:
float strain = rope.CalculateLength() / rope.restLength;
if strain is 1, it means the rope isn't stretching at all. >1 means the rope is stretched, and <1 means the rope is compressed.