小编MrA*_*del的帖子

计算移动球与移动线/多边形碰撞的时间(2D)

我有一个多边形,里面是一个移动的球.如果球击中边界,球应该会反弹.

我当前的'解决方案':我将多边形分成几行,并计算球何时击中移动线 在此输入图像描述

所有变量:

a = length of a
b = length of b
c = length of c
ax = x position of A
ay = y position of A
bx = x position of B
by = y position of B
cx = x position of C
cy = y position of C
vax = speed of A on the x-axis
vay = speed of A on the y-axis
vbx = speed of B on the x-axis
vby = …
Run Code Online (Sandbox Code Playgroud)

java math geometry polygon

5
推荐指数
1
解决办法
268
查看次数

标签 统计

geometry ×1

java ×1

math ×1

polygon ×1