I want to add physycs object somewhere, but only if it does not cause it to collide with something already present.
So far i know i can do ray test, sweep test or just add and try to resolve it when it happens.
ray test is not enough
sweep test
- seems wastefull (I care about one position, not all along line)
- can miss object if it starts inside and moves away from center. I could use 2 sweep test, just over intended position in both directions, but that seems even more wastefull.
Is there better way to do it?
PS: I’m trying to use just collision detection, I don’t want actual physics so unless I change my mind, resolving when it happens is not something I’d like to do (I want to be sure, that there is no tick where objects (that I mind colliding) are colliding (I want to resolve collision by moving back to “safe” position and object will block both old and new position during tick, so old position will be unocuppied)