20-10-2021, 08:29 AM
(This post was last modified: 20-10-2021, 08:30 AM by josemendez.)
Tension is defined as a force that increases strain. Strain is the ratio between the rope's rest length and its current length:
So if you want to increase strain, all you need to do is reduce the rope's rest length so that it is a percentage of the length between the points it is attached to. You can use a cursor to do that, like this:
See: http://obi.virtualmethodstudio.com/manua...ursor.html
Code:
float strain = rope.restLength / rope.CalculateLength();
So if you want to increase strain, all you need to do is reduce the rope's rest length so that it is a percentage of the length between the points it is attached to. You can use a cursor to do that, like this:
Code:
cursor.ChangeLength(Vector3.Distance(attachmentA, attachmentB) * 0.6f); //rope is 40% shorter than the distance between its endpoints.
See: http://obi.virtualmethodstudio.com/manua...ursor.html