box2d icon indicating copy to clipboard operation
box2d copied to clipboard

B2ShapeCast

Open Alexander-r opened this issue 5 years ago • 5 comments

Perform a linear shape cast of shape B moving and shape A fixed. Determines the hit point, normal, and translation fraction.

Ported from upstream.

Alexander-r avatar Feb 09 '20 18:02 Alexander-r

Could you please add a few test cases? Ideally the same than upstream

xtuc avatar Feb 11 '20 19:02 xtuc

I will look into adding tests. This was a rather recent addition so I have not checked how to use it.

But right now on go 1.13.7 all the tests fail because of Printf formatting. Maybe I should fix the formatting for existing tests first?

Alexander-r avatar Feb 12 '20 11:02 Alexander-r

Hey @Alexander-r I went ahead and proposed a PR fixing the issue you put forward on go 1.13. Thanks for doing so!

netgusto avatar Feb 12 '20 12:02 netgusto

I merged #24 into master. Tests should be good on go 1.13 now if you rebase.

netgusto avatar Feb 12 '20 13:02 netgusto

Would something like that be enough for a test? This is based on https://github.com/erincatto/box2d/blob/master/samples/tests/shape_cast.cpp but without actual drawing.

My C++ version for comparing the output: https://gist.github.com/Alexander-r/937980a0bf7f04d8335db71f17b65d1d

Alexander-r avatar Feb 12 '20 16:02 Alexander-r