Ball to Ball Collision - Detection and Handling

前端 未结 14 1581
逝去的感伤
逝去的感伤 2020-11-22 05:29

With the help of the Stack Overflow community I\'ve written a pretty basic-but fun physics simulator.

\"alt

14条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 05:53

    I would consider using a quadtree if you have a large number of balls. For deciding the direction of bounce, just use simple conservation of energy formulas based on the collision normal. Elasticity, weight, and velocity would make it a bit more realistic.

提交回复
热议问题