用于游戏中对象之间的碰撞检测的邻居列表 [英] neighbor list for collision detection between object in game

查看:79
本文介绍了用于游戏中对象之间的碰撞检测的邻居列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨亲爱的

我尝试使用XNA在c#中开发新游戏。

你知道在游戏中我们应该检查每次对象之间的碰撞。但是当我们创建太多对象时,碰撞检测对我的项目非常有害,因为它需要花费太多时间。

我用Google搜索它,所以我发现我必须使用邻居列表来减少检查次数。 br />
你可以帮帮我,或者你已经看过这段代码了。

最好的考虑

Hi dear
I try to develop a new game in c# with XNA.
you know that in game we should check collision between objects in each time. but when we create too many object, collision detection is very harmful for my project because it take too much time.
I googled it so i found that i have to use neighbor list to reduce check counts.
can u help me or did you saw this code already.
best regard

推荐答案

其实我的想法您正在寻找的是二元空间分区(BSP)树。它们是一种经过验证的方法,用于查找靠近其他物体的物体,这将减少您的碰撞检测代码。



https://www.google.com/search?q=bsp+tree+collision+detection [<一个href =https://www.google.com/search?q=bsp+tree+collision+detectiontarget =_ blanktitle =新窗口> ^ ]
Actually what I think you are looking for is Binary Space Partitioning (BSP) trees. They are a tried-and-true method for finding objects that are near other objects, which will cut down on your collision detection code.

https://www.google.com/search?q=bsp+tree+collision+detection[^]


软件开发不是通过看到这段代码来完成的,而是通过编写代码来完成的,这是通过使用开发人员的大脑来执行的。



祝你好运,

-SA
Software development is done not by "seeing" "this code", but by writing code, which is performed by using developer's brain.

Good luck,
—SA


这篇关于用于游戏中对象之间的碰撞检测的邻居列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆