Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For creating runtime tight knot
#4
(17-07-2017, 07:24 AM)chanddu Wrote: Hi josemendez, 
                        Thanks for the reply,can you please tell me how to clamp the force that exerted by the user by pulling the rope?

Regards.

Depends on your particular application. For instance, you can measure how much has the user moved since the last frame, and if the movement is too aggressive do this (pseudocode):


Code:
movementDelta = userPosition - oldPosition;
if (movementDelta.magnitude > threshold)
{
    movementDelta = movementDelta.normalized * maxSpeed
}


This gets rid of very fast and sudden movements, forcing user movements to never exceed maxSpeed. But doesn´t prevent the user from pulling too much, albeit slowly. To prevent this,  measure the amount of stress in the rope (actualLenght/restLength) and if it's much larger than 1, freeze the user position.
Reply


Messages In This Thread
For creating runtime tight knot - by chanddu - 08-07-2017, 11:15 AM
RE: For creating runtime tight knot - by chanddu - 17-07-2017, 07:24 AM
RE: For creating runtime tight knot - by josemendez - 17-07-2017, 09:40 AM
RE: For creating runtime tight knot - by chanddu - 19-07-2017, 08:35 AM
RE: For creating runtime tight knot - by TheMunk - 03-08-2021, 05:30 PM