1. Anders Ruud
  2. love
  3. Issues


Issue #467 invalid

[LOVE 0.8.0] World:rayCast BUG if return 0 (Incorrect ray collision).

Antonio Moder
created an issue

I'm found BUG in World:rayCast. (https://love2d.org/wiki/World:rayCast) If use "return 0" in callback() then - incorrect ray collision: https://love2d.org/forums/download/file.php?id=5204

But - I run "Testbed" from Box2d: https://love2d.org/forums/download/file.php?id=5205

See attach .love file.

Comments (2)

  1. Boolsheet

    Mode 0 in the Testbed RayCast test does not mean that it returns 0 in the callback. It's a mode defined in the test source and means that it will search for the closest fixture.

    Read the wiki entry and the Box2D manual again. You can not make assumptions about the order of the fixtures you'll get to the callback. If you immediately return zero, it will terminate at the first fixture it hits.

  2. Log in to comment