Collisions with no responses?

Blitz3D Forums/Blitz3D Beginners Area/Collisions with no responses?

Irvau(Posted 2015) [#1]
Just wondering, is there a way for Collisions() to be set with no responses whatsoever?

I'm trying to make a missile object to be detected as having hit an enemy, and make it continue on to possibly hit others.
Right now, I'm forced to use response #2, causing the bullet to kill the enemy and also "swerve' around it. XD

Help please?

EDIT: I'd rather not resort to using EntityDistance(), by the way. The meshes of the enemies aren't all spherical; some are shaped like walls. That would produce undesirable premature explosions.


Stevie G(Posted 2015) [#2]
If you seach the forums for 'no response collisions' you should find plenty of examples.

As your enemies are likely to be moving targets, using the native collisions may not be a good option. You could use the following alternative approach ..

For each enemy, store the radius of a bounding sphere (encompasing the whole object) and also the object's bounding cube, by storing it's half height, half width and half depth. Also, store the missile's bounding radius.

The following assumes the e\mesh is centred along all it's axis' but it would also be easy enough to include and offset if required.

For e.enemy = each enemy
  if entitydistance( e\mesh, Missile ) < ( e\BoundingRadius + MissileRadius)
     ;There is a potential collision
     ;Transform the missile's global position into the enemy local space
     ;Check if the missile is contained within the enemies orientated bounding box
     tformpoint 0,0,0,Missile, e\mesh
     if abs( tformedx() ) < ( e\halfwidth + MissileRadius )
       if abs( tformedy() ) < ( e\halfheight + MissileRadius )
          if abs( tformedz() ) < ( e\halfdepth + MissileRadius )
             ;There has been a collision - do stuff
          endif
       endif
     endif
  endif
next



RemiD(Posted 2015) [#3]
Another approach : each mainloop, create one or several ellipsoids set as childs of a pivot, then turn move the pivot, then calculate collisions (updateworld), then for each ellipsoid, check if a collision happened between this ellipsoid and a collidable, then get infos about the collision, then delete the ellipsoids.
This way your projectiles will be able to go through collidables and detect collisions.


Irvau(Posted 2015) [#4]
Thanks!