Author Topic: Collision detection only working occasionally  (Read 1903 times)

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Collision detection only working occasionally
« on: July 25, 2013, 10:04:06 pm »
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:

Code: [Select]
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.



Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: Collision detection only working occasionally
« Reply #2 on: July 25, 2013, 10:24:39 pm »
Works!