Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rest length show incoherent value
#3
(17-11-2022, 12:04 PM)josemendez Wrote: Hi!

The rest length is -as the name implies- the length of the rope at rest: this is, when it isn't stretched nor compressed. You can stretch a 4.28 meters long rope until it reaches 15 meters, but that doesn't change the fact that the amount of rope in there is still 4.28 meters, and will return to 4.28 once the stress forces cease to act upon it: no matter is created/destroyed in the process Guiño.

The actual length can be completely different from the rest length depending on how much the rope is stretched or compressed. The rest length is determined when you create the rope blueprint, while the "actual" length must be recalculated at runtime since it can change. To calculate the current length of the rope, use rope.CalculateLength().

There's something useful you can do with both rest length and the actual length, and that's to calculate strain: a measure of how much stretch/compression the rope is undergoing. This is just the ratio between both values:

Code:
float strain =  rope.CalculateLength() / rope.restLength;

strain will be > 1 if the rope is stretched, < 1 if it's compressed, and 1 if there's no stress forces acting upon it.


Knowing the rest length is useful when dealing with cursors because they set the rest length of the rope: they "add" or "remove" matter to/from the rope, so to speak. The rope may very well be stretched under a lot tension while this happens, or may not be at all.

let me know if you need any help,

kind regards

Ok the name wasn't clear for me, because when we add/remove particles it changes the "rest" length. But it's more clear now with your answer, thank you a lot !

If I want to clamp the length of the rope to its rest length, do you think it could be a great idea to for example reduce its length when strain is above 1 ?
Reply


Messages In This Thread
Rest length show incoherent value - by lufydad - 17-11-2022, 11:24 AM
RE: Rest length show incoherent value - by lufydad - 17-11-2022, 12:37 PM