Collision detection

Blitz3D Forums/Blitz3D Beginners Area/Collision detection

syfax(Posted 2003) [#1]
Me again :)
OK I've now got a little game with two planes flying around a terrain and the human one can fire shots (they weren't kidding when they said you could learn Blitz fast).

What's the best way of detecting when the shots hit the planes. The problem is that neither is particularly spherical so I don't want to use the normal collision commands, and it says the mesh-intersecting thingy is very slow.

My best idea so far is to make a low-poly untextured model that moves around with the detailed one, and use that to detect collisions with meshesinteresect.

Thanks


(tu) sinu(Posted 2003) [#2]
a simple way would be to do a check for if a bullet exists then a distance check between the bullet and plane and then do a meshesintersect if the distance is less than a value.


GfK(Posted 2003) [#3]
Alternatively...

Position the handle/axis of your bullet right at the front of the object, and give it a collision radius of 1.

After all, what are the chances of the side/back of the bullet hitting something when the front of it didn't hit anything?


syfax(Posted 2003) [#4]
Ok thanks guys, both sounds rather better than my ideas :)

I will experiment...

Oh actually GFK, how do I get the handle to the front of the bullet? By creating a pivot there and parenting the bullet to it?


GfK(Posted 2003) [#5]
Oh actually GFK, how do I get the handle to the front of the bullet? By creating a pivot there and parenting the bullet to it?
You can do it that way, OR you can set the handle position in your 3d modelling package. How you do it depends on which package you're using.

In Max4 (which I use), position the front of the bullet at 0,0,0 (where the thick black lines cross), highlight the bullet and choose "Export selected...".