Corona sdk物理两个圆形物体之间的精确碰撞

发布于 2024-11-24 05:22:19 字数 96 浏览 7 评论 0原文

我正在准备一场高尔夫球比赛的开始,球滚入洞中。我让它工作了,但是当球只是接触到洞的边缘时,碰撞事件就会使它掉进去(消失)。我想创造更精确的效果,使其更加真实。任何建议将不胜感激。

I am working on the start of a golf game where a ball rolls into a hole. I have it working, but when the ball simply touches the edge of the hole, the collision event makes it drop in (disappear). I want to create more precision so that it will be more realistic. Any advice would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怎樣才叫好 2024-12-01 05:22:19

解决这个问题最简单的方法是让真实的物体成为一个比用户看到的显示球更小的隐形球。您还可以操作碰撞前和碰撞后事件处理程序来处理此问题。

您还应该警惕速度在 Box2d 碰撞中很重要这一事实。根据我的经验,这种机制经常需要一些调整。

http://developer.anscamobile.com/content/game-edition-collision-detection

The easiest way to solve this problem is have the real body be an invisible ball smaller than display ball that the user sees. You can also manipulate the pre and post collision event handlers to deal with this.

You also should be wary of the fact that speed matters in Box2d collisions. This kind of mechanic often takes some tweaking in my experience.

http://developer.anscamobile.com/content/game-edition-collision-detection

ら栖息 2024-12-01 05:22:19

当您检测到与孔的碰撞时,您可以启动过渡。这种转变需要一些时间才能完成,从而消除“球立即消失”的问题,并且通过一些数学运算,可以正确反映球的速度和方向,以便球落入洞中看起来相当真实。

You could start a transition when you detect the collision with the hole. That transition would take some time to complete, eliminating your "ball immediately disappears" problem, and with a little math, could properly reflect the speed and direction of the ball so that the drop into the hole looks fairly realistic.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文