pfirsich / Ray-casting-test

This is an implementation/comparison of various methods for ray casting in 2D grids, also referenced in my corresponding blog post: http://theshoemaker.de/2016/02/ray-casting-in-2d-grids/
9 stars 1 forks source link

Update main.lua #1

Open tuuling opened 5 years ago

tuuling commented 5 years ago

When dir is 0 the path stays infinitely on one axis. Not sure how Lua works.. perhaps you could even do dt = inf ?

pfirsich commented 2 years ago

This is still dividing by dir, so instead of inf and inf getHelpers returns inf and nan.

tuuling commented 2 years ago

This was 3 years ago. I remember I ported this script to Typescript and included a separate case where dir === 0 was handled.