Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Aug 20, 2008 10:58 pm 
Offline

Joined: Fri Aug 31, 2007 6:36 am
Posts: 32
I also posted the issue here: http://code.google.com/p/bullet/issues/detail?id=79

Basically, while creating a "sensor" type object I noticed that my vehicles were sometimes colliding with the sensor body. For example, while driving on a curved surface I would hit a static plane sensor even though it was set to no contact response. The body of the kart would go through it no problem but sometimes the wheels would seem to "catch" onto to the plane.

After a bit of thinking I realized that the btDefaultVehicleRaycaster doesn't check if the body that is casted against has contact response enabled.

The fix is very simple:

Old code:
Code:
if (rayCallback.hasHit())
    {
        btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
        if (body)


New code:
Code:
if (rayCallback.hasHit())
    {
        btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
        if (body && body->hasContactResponse())


So I basically wanted to just post this for anyone having an issue like this with vehicles and get some feedback on this solution.

Thanks.


Top
 Profile  
 
PostPosted: Fri Aug 29, 2008 4:51 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 4054
Location: California, USA
Good point, it has been fixed. If you have other improvements, please let us know.

Thanks a lot for the feedback,
Erwin


Top
 Profile  
 
PostPosted: Thu Sep 04, 2008 4:19 am 
Offline

Joined: Tue Oct 24, 2006 11:52 pm
Posts: 83
Location: Australia
Hi,
Quote:
So I basically wanted to just post this for anyone having an issue like this with vehicles and get some feedback on this solution.

I have seen the same issue, but doesn't your solution causes wheels not touching the ground if they are on top of a body without contact response? I would expect that the ray would then go through the no-contact-body and hit whatever is below (i.e. the raycast needs to be fixed, not the result of the raycast).

This behaviour would be bad for our game SuperTuxKart: we have 'zipper' (flat quads) on the track that have no contact response set. If suddenly a wheel on top of a zipper would lose contact with the track (because the raycast returns no object instead of the zipper), it would mean that only one of the wheels causes a force to act on the body, which means the kart starts turning or rotating (see viewtopic.php?f=9&t=2047).

Cheers,
Joerg


Top
 Profile  
 
PostPosted: Thu Sep 04, 2008 3:20 pm 
Offline

Joined: Fri Aug 31, 2007 6:36 am
Posts: 32
That is a good point hiker. Perhaps the fix should be in the ray caster. Maybe it could be an option. Some may want to cast against no contact bodies and others (like us) do not.


Top
 Profile  
 
PostPosted: Thu Sep 04, 2008 6:04 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 4054
Location: California, USA
The raycast should just ignore the object and continue with other objects, including the ones underneath.

Can someone double-check this?
Thanks,
Erwin


Top
 Profile  
 
PostPosted: Thu Sep 04, 2008 7:00 pm 
Offline

Joined: Fri Aug 31, 2007 6:36 am
Posts: 32
I can't find where this happens. Do you know which class and function this is supposed to happen in?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group