Collision Problems

Blitz3D Forums/Blitz3D Programming/Collision Problems

Billp(Posted 2008) [#1]


I am writing a space trading game and my ships are built with seperate component meshes parented to a pivot, whenever collisions occur the components are skewed out of alignment, I can't combine them into a single mesh as I am animating them by rotating the lifesystems, flashing lights etc., I am considering creating a seperate collision mesh using add mesh but would like to detect collisions against the individual components if possible for realistic damage allocation.....

any ideas ?


Sledge(Posted 2008) [#2]
MeshesIntersect() is slower but will prevent a 'colliding' object being stopped by the object it is 'colliding' against. Used only after an EntityDistance() (to rule out meshes that can't possibly be intersecting) it might do the trick.

You also presumably know the relative position of each section of the ship to the pivot so you can always just reset them as and when required.

Is it not possible to have each section of the ship as a child limb of the pivot (like in an animated mesh)? That way the whole ship will collide but you'll be able to determine which particular area was damaged?

Just three ideas there.


Vertigo(Posted 2008) [#3]
Do checks against spheres instead of the individual objects, many less collisions checks that way too. Set entityradius for the pivot and check against that. If the parts are parented to the pivot then they will stay put when the pivot itself hits something.