I have several nodes in my scene which i can rotate and drag around. I've set up a physicsWorld delegate, added physicsBody with type kinematic to my nodes and check for physicsWorld didBeginContact - up to this point everything is ok, when i move the nodes , the contact begin/end fires.
The way i'm trying to handle this is to set a bool var that change to true once the contact start to prevent further movement, but i'm running into cases (especialy if i drag the node too fast) , that the node gets a little bit inside of the other object.
should i use different approach to this? I don't really want a collision, just the other node to act "solid" and not allow intersection even at higher speed contact.
EDIT:
Some sample images to further clarify the issue:
For simplicity i've added only 2 nodes to demonstrate the issue. First image is initial position, 2nd and 3rd (side view) are after a very fast pan to the right. The contact detection was fired only after nodes were already intersected.
One approach that I tried was grabbing the last position before the contact is triggered and reseting the node position after contact is detected, but the result is very choppy and unstable and for a split second you can sometimes see the objects intersecting anyway before jumping to the last "good" position. I feel there must be some easier way to achieve this, but after spending hours going through available resources i can't figure it out.
EDIT 2
further research pointed down the line of sweep testing, technicaly if i can detect possible collision before i move the node, i should be able to restrict the movement to stop before the intersetion occurs
UPDATE: another dead end, as Xcode points out
Error: convexSweep only works with convex shapes