Collision detection in 3d world

I am creating a three-dimensional racing game and still have a built-in accelerometer and I can move the car through the city, the only thing left in my game is collision detection ... I want to stop my car when it hits the wall, etc. d.

How can i do this? I know the boundingVolume property, but I have a city (a 3D world as one node) and a car, since you can detect when it collides with walls, etc.

Please tell me what should be my approach? any sample code? please help as I am new to this and have no experience in it ...

Thanks Amrut

+4
source share
1 answer

Now cocos3d is on version 0.6.2, and, as you know the official site , wrote that “simple conflict detection” is not yet supported! (big problems) They want to implement it in version 0.7.

But I think that you’d better save your locations in the city in a file, and when your car moves to each street, you will find it and load some of the city objects into some variables and now detect “simple collision detection” manually.

I hope this works for you!

+2
source

Source: https://habr.com/ru/post/1379978/


All Articles