XNA 3D custom collision method?

丶灬走出姿态 提交于 2019-12-12 01:09:34

问题


Ok, after 10 hours of digging, I've come to the conclusion XNA really doesn't offer good collision support. Here is my problem.. imagine an apartment building in your game world. Wrap it with a bounding box.. rotate it on the Y axis 45 degrees. Now walk around it. If your camera intersects that bounding box.. you cant walk.. Well.. 50% of the bounding box is incorrect, because the box is axis oriented.. Now, use a sphere. A sphere that large, has ALOT of error.. I guess the question is.. how can I make collision detection with the building, that is rotated.. so I can walk around the building and staying just on the outside of the walls? There is the option of creating 2x triangles per wall, and doing some sort of collision detection there. You could fill the whole wall up with very small collision boxes(seems like a waste). Im really not sure, but after 10 hours of trying to find a good solution, im out of ideas.

Any help is appreciated, thanks.

来源:https://stackoverflow.com/questions/20848562/xna-3d-custom-collision-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!