如何模拟两根棍子的碰撞,就像你在《愤怒的小鸟》中看到的那样?

发布于 2024-11-06 02:15:09 字数 77 浏览 1 评论 0原文

愤怒的小鸟的建筑似乎是由坚硬的棍子组成,会碰撞并倒塌。 我当然想知道该怎么做。我不介意编写原始代码,但肯定有人已经解决了这个问题并将其开源?

The angry birds buildings seem to be composed of rigid sticks that collide and fall.
I sure would like to know how to do that. I don't mind writing original code but surely someone has figured this out already and made it open source?

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

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

发布评论

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

评论(2

颜漓半夏 2024-11-13 02:15:09

您可能想看看 Box2D。这是 Erin Catto 编写的优秀的 2D 刚体动力学库。它不仅是开源的,而且还有许多非常好的 GDC 演示文稿,解释了您可以在库中找到的代码背后的理论。

You might want to have a look at Box2D. This is an excellent 2D rigid body dynamics library written by Erin Catto. Not only is it open source, there are also a number of very good GDC presentations, explaining the theory behind the code you'll find in the library.

真心难拥有 2024-11-13 02:15:09

据我所知,AngryBirds 使用 chipmunk 物理库(但我可能是错的与此)。就我个人而言,我研究了 Box2D 和chipmunk作为2D物理库,我更相信chipmunk。
这也是因为该语言绑定到 Python 和其他语言。他们只是开箱即用。 (没有双关语;))

更新:看来我错了,AngryBirds 显然正在使用 Box2D。

As far as I know, AngryBirds uses the chipmunk physics library (but I might be wrong with that). Personally I have looked into Box2D and chipmunk as 2D physics libraries and I am more convinced by chipmunk.
This is also because the language bindings to Python and other langueges. They just work out of the box. (no pun intended ;) )

Update: seems I have been wrong, AngryBirds is apparently using Box2D.

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