19-07-2017, 08:35 AM
(17-07-2017, 09:40 AM)josemendez Wrote: 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.
Thanks, I will try this and see.
Regards.