大量物体的碰撞检测

发布于 2024-08-01 19:22:47 字数 249 浏览 1 评论 0原文

在给定时间,我在屏幕内有大约数百个移动对象,加上一千多个静止对象。 为简单起见,您可以将其视为有很多球的台球游戏:) 其中一些保持静止,另一些以各种速度向各种不同方向移动。 每当每个球碰撞到另一个球时,我都需要进行碰撞检测。 考虑到性能和编程简单性,最好的方法是什么? 我只是在谈论算法,我想我可以自己实现它,但也欢迎有关实现的建议;)

语言是 C#,XNA 3.1,2D 图形,目标平台仅限 Windows(如果重要的话)。 在此先感谢您的帮助!

I have around several hundreds of moving objects within screen at the given time, plus a thousand+ stationary objects. For simplicity, you can think of it as a billiard game with damn lots of balls :) Some of them are stayin still, some others are moving at all sorts of speeds to all sorts of different directions. I need coll detection each time each ball bumps into another ball. What is the best method, considering performance and, well, programming simplicity? I'm talking algorithm only, I guess I can implement it myself, tho suggestions on implementation are welcome as well ;)

Language is C#, XNA 3.1, 2D graphics, target platform is Windows only (if that matters). Thanks in advance for your help!

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

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

发布评论

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

评论(1

罪#恶を代价 2024-08-08 19:22:47

您可能想查看此问题的答案。

You might want to take a look at the answers to this question.

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