Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi everybody, hi Niko, I'm making a game in coppericht and I have problem with collision detection. In coppercube I made few sceneNodes: planets and ship. Every planet has got two animators: rotate and fly in the circle and ship has got rotate animator. I have a skybox too, prepared in copperlicht. This is first version: http://www.mclog.jawnet.pl/UFOJS... (8mb models and textures may have a long time load). I don't know how to do collision detect between ship and planets. Which functions uses etc. Thanks in advance. Greetings. |
||||
|
I'd suggest to use the bounding box of the ships. Every scene node has a function named getTransformedBoundingBox(). That one again has a function intersectsWithBox(), which you can use to test the collision between two ships. Like
You can even test the collision of lines (for shooting maybe?) with this, and it is quite fast: box1.intersectsWithLine(startpoint, endpoint). For planets, I would test if one of the edges of the box (or maybe just the center?) is within the radius of the planet. |
||||
|
Fantastic and pure simple :D Big thx! |
|