I'm developing a video game, in which I'm making a charactar with rigid-body physics (also known as "ragdoll" physics). The way I've made it is probably not completely realistic, because I only use velocity vectors to calculate the position of each joint of the "ragdoll", based on an initial velocity vector applied to a joint.
If you want to check it out, you can download it here.
The way I do this is illustated in this image:

Anyway, the problem I have now is how to calculate the velocity vector of joints that make an angle that is restricted (an angle that shouldn't get any bigger, for example). This simplified diagram illustrates my problem:

In the diagram, how should I calculate vectors v1 and v2? Note that in the diagram, the entire body should be rigid, because of the angle restriction.
I would truly appreciante any help on this...











