简体   繁体   English

如何检测与C ++,OpenGL和Freeglut的冲突?

[英]How do I detect collision with C++, OpenGL, and freeglut?

I am making a maze game, and I know how to do everything except make it so that you can't just cheat your way through the walls. 我正在制作一个迷宫游戏,我知道该怎么做,除了制作它之外,这样您就不能只是在墙壁上作弊。 I am using freeglut with OpenGL in C++ and I would like to know the most effective way of using collision detection ( hopefully without needing to use anything other than freeglut). 我在C ++中将freeglut与OpenGL一起使用,我想知道使用冲突检测的最有效方法(希望无需使用freeglut以外的任何方法)。

OpenGL is just for drawing; OpenGL仅用于绘图; it makes things appear onscreen at the coordinates you specify, but it doesn't play a role in deciding what the coordinates of your objects should be. 它使事物在您指定的坐标处显示在屏幕上,但在确定对象的坐标应为什么时不起作用。 For motion and collision, you may want to use a physics library, such as ODE or Bullet . 对于运动和碰撞,您可能需要使用物理库,例如ODEBullet (There are also bigger, more commercially-oriented physics systems like Havok and PhysX , but those are probably overkill for a simple project.) (也有更大的,更商业化的物理系统,例如HavokPhysX ,但是对于一个简单的项目而言,它们可能会显得过高。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM