Problems with Rays

Ludi83
Posts: 2
Joined: Tue Jul 29, 2008 7:21 pm

Problems with Rays

Post by Ludi83 »

Hi,

I'm using btCollisionWorld::rayTest() to try to simulate a railgun (like the on you all know from Quake). The problem is, that the rays does everything, but not what it should, except in some cases. I've attached some screenshots:

Here's the wire shot of the world:

Here's the aabb shot of the world:

Here, i shoot at the gound and you can see, that the ray hits the ground correctly (you can see it, as you can see the wire frame of the decal)

Here, I try to shoot at the building and the ray goes through it, don't know where it stops.

Here, I try to shoot again, but a little bit closer, but the ray goes through the wall and hits the inside, somewhere.

Here, I'm very close to the building, shoot again, and the ray hits where it should it.

And when I try to shoot the big green box, the ray doesn't even recognize it and says that it hit nothing.

I really don't understand what's wrong here. Am I using the ray wrong (I'm using btCollisionWorld::ClosestRayResultCallback, btw. it worked with the build in collison system of the engine, but I want to replace it with bullet)? Or is there another solution to create some sort of instant-hit weapon with bullet?

Edit: Pics removed.
Last edited by Ludi83 on Thu Sep 11, 2008 4:22 pm, edited 1 time in total.
Ludi83
Posts: 2
Joined: Tue Jul 29, 2008 7:21 pm

Re: Problems with Rays

Post by Ludi83 »

Okay, I just upgraded from 2.7 to 2.71 and everything seems to work.