Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Rest Length" returns unexpected values
#2
rope.restLength returns the rest length of the rope in meters. It's just the accumulated distance from each particle in the rope to the next one, as you describe.

Did a quick test of a straight 2 meter rope, and restLength always returns 2. This is the code and the results:

Code:
void Update()
    {
        Debug.Log(GetComponent<ObiRope>().restLength);
    }

[Image: yoqJk9p.png]

Changing the resolution does not affect it at all (since the rope is completely straight, there's no way it could affect the outcome!). In a curved rope increasing resolution will slightly increase the rest length, as the discretization is finer. Never had any bug reports regarding this, should just work as it's very simple stuff.

Can you share more details about what you're doing? How are you generating the rope? How are you getting the rest length?

Quote:The start and end points were exactly 2m apart, but the rope's reported rest length was reported to be 42!

Having the start and end points 2 meters apart from each other does not guarantee the rope to be 2 meters long. Depending on what the input/output tangents of the control points are, the rope could be much larger or smaller, as you can have a much longer curve with lots of particles that just happen to be collinear.
Reply


Messages In This Thread
RE: "Rest Length" returns unexpected values - by josemendez - 20-05-2021, 05:01 PM