deltaluca/nape

PreCallback.swapped is wrong

Opened this issue · 1 comments

    space.listeners.add(new PreListener(
        InteractionType.COLLISION,
        Jumper.CBTYPE,
        JumpSurface.CBTYPE,
        function(cb:PreCallback):PreFlag {
            var a = cb.arbiter.collisionArbiter;
            if (cb.swapped && cb.int1 == a.shape1.body) throw "swapped error";
            ...
        }
    ));

If I understand correctly, the "swapped error" should never be thrown, but it is.

I haven't reproduced it in a small sample yet, but in the main project it sometimes occurs on a collision between a Dynamic Jumper and Kinetic JumpSurface.

It doesn't happen when the JumpSurface is not moving (but then swapped is always false, a side effect of the order in which things are processed?)

Similar to #102.