Hello everyone, I prevent a perplexing problem.
Let's say I have two click-and drag nodes, with a bar that always extends between them. A simple matter to program.
<img src="http://i.imgur.com/cg0Pv.png" border="0" />
The nodes can be dragged around the layout at will and the bar will always extend between them (simple programming).
Now, in the context of this arrangement, there will be some walls/obstacles in the layout.
<img src="http://i.imgur.com/X08tW.png" border="0" />
How can I program the arrangement so that the user can never position the system so that any object (nodes or bar) intersects any wall?
Here's a capx of the example. It's pretty simple as I haven't implemented any sort of collision prevention.
So, what do you think I should do? I thought of using physics, but that brings problems with clicking and dragging...