vrld / HC

General purpose collision detection library for the use with LÖVE.
http://hc.readthedocs.org/
404 stars 48 forks source link

Crash in cut_ray #24

Closed CalinLeafshade closed 11 years ago

CalinLeafshade commented 11 years ago

I get the following crash intermittantly:

Error: hardoncollider/polygon.lua:390: attempt to index local 'q' (a nil value) stack traceback: hardoncollider/polygon.lua:390: in function 'cut_ray' hardoncollider/polygon.lua:407: in function 'contains'

I can't reproduce the bug on cue and i can't see how q could possibly be nill unless the vertex count of the polygon was 0 which does not seem to be possible.

vrld commented 11 years ago

Hm, that is very strange indeed. Do you know what kind of shapes (e.g. hexagon, sharp triangle, ...) may cause this?

CalinLeafshade commented 11 years ago

It has happened on rectangles and irregular polygons

vrld commented 11 years ago

Closed because I'm unable to reproduce the issue :/