RayTest not giving accurate hitlocation

jacobsgriffith
Posts: 3
Joined: Mon Feb 03, 2014 10:38 pm

RayTest not giving accurate hitlocation

Post by jacobsgriffith »

Hello all, first post here!

Bullet has been good to me so far but I've ran into a problem I just can't seem to get past.

I've posted on stack exchange with full details and pictures
http://gamedev.stackexchange.com/questi ... ce-picking

Can anybody shed any light on the situation? If you need anymore information just let me know and I'll make sure to update the question or post the information here. Thanks!
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: RayTest not giving accurate hitlocation

Post by Basroil »

Did you check if your case falls into https://github.com/erwincoumans/bullet3/issues/34 ? 2.82 seems to have broken some cases of ray testing, so either reverting to an older version or applying your own patch (or waiting for the official one) might help.
jacobsgriffith
Posts: 3
Joined: Mon Feb 03, 2014 10:38 pm

Re: RayTest not giving accurate hitlocation

Post by jacobsgriffith »

I tried adding the following code

Code: Select all

rayCallback.m_flags |= btTriangleRaycastCallback::kF_UseSubSimplexConvexCastRaytest;
but I'm still getting the same result. Does the above code truly get past the 2.82 bug? If not do you have any other ideas?
jacobsgriffith
Posts: 3
Joined: Mon Feb 03, 2014 10:38 pm

Re: RayTest not giving accurate hitlocation

Post by jacobsgriffith »

I have flipped all vectors x axis that I get from bullet because I found out Directx uses left handed coordinate systems and bullet uses right handed.

So now that solves the flipped positioning but the square is still off almost like it's being multiplied the further I get away from world origin. I'll try downgrading to 2.81 I guess and see if that helps
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: RayTest not giving accurate hitlocation

Post by Erwin Coumans »

Can you create a reproduction case of the failing raycast in the Bullet/Demos/RaytestDemo? Then share the zipped file on this forum, or submit an issue in the github tracker at http://github.com/erwincoumans/bullet3 (which includes Bullet2 too)