www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Irony on July 25, 2013, 10:04:06 pm

Title: Collision detection only working occasionally
Post by: Irony 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:

Still, only collides 1 out of 3 times.


Title: Re: Collision detection only working occasionally
Post by: EgonOlsen on July 25, 2013, 10:10:39 pm
Try to increase this value: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#collideOffset (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#collideOffset)
Title: Re: Collision detection only working occasionally
Post by: Irony on July 25, 2013, 10:24:39 pm
Works!