Dear Babylon community,
I’m currently trying to implement some basic collision detection while dragging, but I got a bit stuck. I have walls that are anchored to a corner mesh that I would like to drag around, changing the walls afterwards.
I made a first example:
If you drag the red sphere, the green wall is moving, and it cannot be moved over the blue wall (using two hinge joints, works quite nicely).
Now, I’d like the green wall to stretch and shrink depending on the distance of the red sphere while still colliding with the immovable blue wall. The other anchor point will always be fixed. I looked into slider joints and distance joints, but I actually do not really understand how to implement the behavior I’m looking for.
I’d especially like to get to the point where I could attach multiple walls to the same corner, e. g. as in these two playgrounds:
Do you have some tips for me how I can reach the desired outcome?
Kind regards,
Zacherl