collision options?

Blitz3D Forums/Blitz3D Beginners Area/collision options?

Pete Carter(Posted 2006) [#1]
im making a side 3d scrolling shoot em up like einhander/r-type delta, ive got a problem with collisions, when testing the game with a friend we noticed that because of the basic collision detection in blitz3d (sphere 2 poly) a small bullet from an enemy that looks like is going to miss your ship hits it. i know that poly 2 poly collision in blitz is slow so what are my other options. i only need collision to be spot on with the players ship not the enemys. is it worth me using tok or ode to get poly to poly collisions. bare in mind im not the best programmer in the world.

Pete


Matty(Posted 2006) [#2]
If the player ship does not animate then what is wrong with using sphere(bullet)->poly(player ship)? - As long as you use an appropriate radius for the bullet?


Beaker(Posted 2006) [#3]
Use EntityDistance() initially and if that returns true use LinePick() (or MeshesIntersect() at a push).


Pete Carter(Posted 2006) [#4]
ill look into both options. with your option matty how would i do collision for my ship (poly) with my mesh im using as the space station your flying through? can you make the ship mesh have 2 types of collision types?


Sledge(Posted 2006) [#5]

can you make the ship mesh have 2 types of collision types?



No, but you can define two Collisions checks: Sphere-to-poly for the ship-to-level mesh, then sphere-to-poly for bullets-to ship. So on one check the ship's mesh is used, and the other its collision radius, as appropriate.

Incidentally, Ice-Teroids uses MeshesIntersect() rather than the built-in collision system... it's not *that* slow (especially if you're sensible about geometry complexity) and you'll have fun with collisions between two moving objects using the Collisions command.


Pete Carter(Posted 2006) [#6]
oh so sledge does that mean that you would use Beaker's idea and have entitydistance and then a meshintersect.

i take it i can model a basic shape make it a child of the ship, then make its alpha zero and use that for meshintersect, so i can still have a detailed ship model ?

Pete


Sledge(Posted 2006) [#7]

oh so sledge does that mean that you would use Beaker's idea and have entitydistance and then a meshintersect.



It would be high on my list - if the shape of your ship allows entitydistance only then that would be even better.


i take it i can model a basic shape make it a child of the ship, then make its alpha zero and use that for meshintersect, so i can still have a detailed ship model ?


That's the idea. Bear in mind that flat meshes that overlap won't flag as intersecting with meshesintersect() - the meshes need to transcend all three axes.


Pete Carter(Posted 2006) [#8]
That's the idea. Bear in mind that flat meshes that overlap won't flag as intersecting with meshesintersect() - the meshes need to transcend all three axes.


i dont quite get what you mean? are you saying the whole mesh has to be inside the second mesh? sorry im new to meshesintersect


Sledge(Posted 2006) [#9]

i dont quite get what you mean? are you saying the whole mesh has to be inside the second mesh?


No - sorry to be confusing. The meshes need an x, y and z component... if you're smart the first thing you'll do is define collision geometry that is flat in order to keep its complexity as low as possible. But flat meshes (ie those which are sat on the same plane) are never considered to intersect by meshesintersect() - I wanted you to know that before you started defining your collision meshes. Define collision meshes with a height, width and depth.


Pete Carter(Posted 2006) [#10]
thanks i see what you mean now.