3D世界中的碰撞检测
我正在创建一个 3D 赛车游戏,到目前为止,我已经集成了加速度计,我可以在城市中移动汽车,现在我的游戏中唯一剩下的就是碰撞检测...我想在汽车撞到墙壁等时停下来...
我该怎么做?我知道boundingVolume属性,但我有一个城市(3d世界作为单个节点)和汽车,那么如何检测它何时碰撞墙壁等?
请问你能告诉我我的方法应该是什么吗?有示例代码吗?请帮助,因为我是新手,没有任何经验......
谢谢 阿姆鲁特
I am creating an 3d car racing game and till now i have integrated accelerometer and i can move the car through the city the only thing now remaining in my game is collision detection ... i want to stop my car when it bangs on wall etc ...
how can i do that ? i know boundingVolume property ,but i am having an city(3d world as a single node ) and car so how can detect when it collides wall etc ?
please can you tell me what should be my approach ? any sample code? please help as i am new to this and don't have any experience in it ...
Thanks
Amrut
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
现在cocos3d已经是0.6.2版本了,正如你所知官方网站写道“简单尚不支持碰撞检测! (大麻烦)他们想在0.7版本中实现它。
但我认为您最好将城市位置保存在文件中,当您的汽车移动到每条街道时,您会检测到它并将城市位置的某些部分加载到某些变量中,然后手动检测“简单碰撞检测”。
我希望它对你有用!
Now cocos3d is on 0.6.2 version and as you know official site wrote that "simple collision detection" not supported yet! (big trouble) They want to implement it in 0.7 version.
But I think it is better for you to save your city locations in the file and when your car moved to each street you detect it and load some part of city locations into some variables and now detect "simple collision detection" by hand.
I hope it works for you!