I'm programming a snake-type game in 3 dimensions without grid constraints where the location of the new 'block' is determined by:

> 
> [Normalized(lastBlockLocation - cursorLocation) \* blockLength] + lastBlockLocation
> 
> 
> 

where locations are 3D vectors and blockLength is an scalar. With this code, I make the snake follow the player without caring of the actual distance; however, I would also like to add a system to avoid too sharp angles.

So, here's the question: how can I clamp a vector so it has a maximun angle n with a know vector?