Oval collision detection not working properly

后端 未结 4 1942
逝去的感伤
逝去的感伤 2021-01-24 01:54

So I\'m trying to implement a test where a oval can connect with a circle, but it\'s not working.

edist = (float) Math.sqrt(
    Math.pow((px + ((pwidth/2) )) -          


        
4条回答
  •  北荒
    北荒 (楼主)
    2021-01-24 02:36

    If you plan on implementing more shapes and/or need the minimum distance between your shapes, you could start using GJK : you would only need to implement the support functions for each new shape. If computation time is also critical, GJK is definitely something you should look at, but it would surely require some more programming on your side.

提交回复
热议问题