减速和加速
我正在制作一款 Android 游戏,我正在寻找一个关于球碰撞检测的相对简单的教程。特别是两个球之间的弹性碰撞(也就是说,球在碰撞后的行为方式 - 有点像撞球时的撞球)。
另外,如果有人知道有关减速和加速的示例/教程,我将不胜感激。我正在检测两个球是否彼此接近(尚未碰撞)。如果球 1 位于静止球 2 的一定半径内,则球 1 将开始减速。一旦球 1 到达更靠近球 2 的另一个点,球 1 将改变方向并开始再次加速到其原始速度。
我可以检测到第一次碰撞并使球 1 减速,并改变其方向,但我实现的加速度不正确。
如果有人知道这样的例子,你能指出我正确的方向吗?
Im making an Android game and I'm looking for a relatively simple tutorial on ball collision detection. In particular an elastic collision between 2 balls (That is to say how balls would behave after the collision - kinda like pool balls when they collide).
Also, if anyone knows of an example/ tutorial on deceleration and acceleration I would appreciate it. I'm detecting if 2 balls are in proximity (not colliding yet) with each other. If ball 1 is within a certain radius of a static ball 2, ball 1 will start to decelerate. Once ball 1 reaches another point closer to ball 2, ball 1 will change direction and start accelerating again to its original velocity.
I can detect the first collision and decelerate ball 1, as well as switch its direction, but the acceleration I implemented is not correct.
If someone maybe knows of such an example, can you maybe point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://www.euclideanspace.com/physicals/dynamics/collision/twod /index.htm
http://www.gamasutra.com/view /feature/3015/pool_hall_lessons_fast_accurate_.php
http://www.euclideanspace.com/physics/dynamics/collision/twod/index.htm
http://www.gamasutra.com/view/feature/3015/pool_hall_lessons_fast_accurate_.php