Collision detection only working occasionally

Started by Irony, July 25, 2013, 10:04:06 PM

Previous topic - Next topic

Irony

That's strange.. when I fly my jet into a space station (about 5x the size), often fly right trough it. When I turn around and try it again one, two or three times, the ship crashes okay. Same thing happens when colliding with other objects (all bigger than the jet)

Code snippet that is called every frame:


if (model.checkForCollision(xAxis, (float) (speed*ticks)/100) != Object3D.NO_OBJECT) {
   kill();
}


(xAxis points forward)

Already checked:

  • latest Engine version
  • Collision_check_self is set on jet model
  • Collision_check_others is set on space station model
  • Objects are all built
  • Tried to play around with the "step" parameter making it longer/shorter

Still, only collides 1 out of 3 times.