18-03-2020, 12:42 PM
(18-03-2020, 09:32 AM)josemendez Wrote: Hi there,
Yes, a cable is made up of multiple cable joints, that attach to links. Each link can be of 4 different types (attachment, rolling, pinhole or hybrid). So a cable looks like this:
Code:Link ----(cable joint)--- Link ----(cable joint)---- Link ---...etc
Each cable joint stores a value (impulse magnitude) that is basically the amount of "instant" force applied by each joint. To convert an impulse to a force you need to divide by the delta time, so you can get a tension force in Newtons. To get the mass in Kilograms "seen" by the cable at its ends, divide by acceleration (since F = ma). In case of a simple load hanging from the cable, use gravity (-9.81f m/s2). This will print out the force applied and mass lifted by each cable joint in a cable:
Code:IList<CableJoint> joints = cable.Joints;
foreach (CableJoint j in joints){
float force = j.ImpulseMagnitude / Time.fixedDeltaTime;
Debug.Log(force + " N, Mass:" + force/-9.81f +" Kg");
}
Thank you for the detailed reply. I just implemented it and it seems to work like a charm!