Forums

Full Version: physics glitch
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
every once in a while i hit a major physics bug.
once in the F1-02 on a track that i can't remember. once just a few minutes ago in the TC6 on Laguna Seca.

with the tc6 i was on a straight and one wheel just barely tapped the sand and all of a sudden i was stuck in one of those walkways that goes over the track. i was going about 30-40 kmh.
and i didn't just float/fly up there. i just appeared inside of it.

with the f1-02, i was going about 100 kmh and the car flew up in the air. maybe about an eighth mile up. this time i didn't go off of the road at all. and the car was doing insane flips and rolls in the sky. it took a long time to come back down to earth and it never stopped doing flips once it came back.

edit- the f1-02 was with release 2009-6-15. the tc6 just now was with the latest revision as of this bug report
Thanks portets, I'll have a look into the collision code.
Could you try to reproduce the bug. A screenshot of the position where it happens would be great too. It would simplify debugging a lot.
well as it's a rare bug, you might not get to see me post it for a while, but i'll keep trying.

meanwhile, i uploaded a picture that shows where it happened.

[Image: 9_bug.jpg]

my wheel hit right about where i circled green in the image, then i appeared in the bridge section circled in red.
So it happens when you leave the track. It has to be related to bullet collision detection.
well, with the F1-02 on the 2009-6-15 release i didn't leave the track.

but maybe the track i was on had a small bump? after all the F1-02 is lightweight, right?
it happened again!! but this time i caught it :wink:

[Image: f_vbug.jpg]

[Image: 7_vbug2.jpg]

this time in sv on laguna. i don't think any wheels touched the sand this time. maybe, i'll try to reproduce it one more time. also happened with the sv an neurburgring an hour back. also underneath a bridge. this bug definitely looks like it has to do with solid objects standing above tracks.

you're lucky i have so much free time. Big Grin i spent all day trying to expose the bug :lol:
Wow, thanks portets. Will look into it asap. I am really impressed by your dedication and persistence. Big Grin
Good news, with portets help I was able to track down the bug to CARDYNAMICS:TonguerocessContact().

The bullet code sometimes reports an incorrect collision of the car chassis with bridges. Like car not passing but penetrating the bridge. The bridge mesh is a concave object(means not trivial to check for collisions). I have to look into bullet to make sure it is handled the right way. So no quick solution on this one.

Another topic is the way collisions are resolved in ProcessContact(). It's done by projection + inellastic collision with damping on the torque. I patched it a bit, but it's still not exactly correct. :wink:

Maybe we should go for bullet collision resolution here.

Edit:
Oops, looks like the wheels are causing the problem.
Take a F1 at Laguna Seca and leave the track like this and prepare for take-off Smile :
[Image: bug49w9l.jpg]
You will have wheel overtravel(wheels shooting through your suspension) of about 20 meters. Will try to fix it.
Fixed in current version. Wheel collision ray start position was dependent on vertical wheel velocity. So on bumpy surfaces the wheel ray started like 3-6 meters above the car generating collisions with bridges.
The reason for using velocity is to cover cases where the car is moving downward quickly (like after a jump) and we don't want to fall through the ground due to missing the collision between frames. How about using the car body's velocity instead of the wheel velocity like so:
Code:
float moveback = -car.GetVelocity();
okay, so no more getting caught in bridges! Smile

but now neurburgring won't load :?
other tracks load fine. and going back to the previous revision fixes it.

Code:
INFO: Car loading was successful: T73
vdrift: include/mathvector.h:329: MATHVECTOR<T, 3u> MATHVECTOR<T, 3u>::Normalize() const [with T = double]: Assertion `mag != 0' failed.
SIGABRT detected, releasing the mouse
Aborted
@joe
Yeah, the idea was clear. I was just assuming that the car wont have such high vertical speeds(2*wheel_radius/dt). I know making assumptions how something is going to behave is not a good idea in general.

@portets
Fixed in current version. I didn't check the length of a vector before normalizing it.
portets Wrote:... with the f1-02, i was going about 100 kmh and the car flew up in the air. maybe about an eighth mile up. this time i didn't go off of the road at all. and the car was doing insane flips and rolls in the sky. it took a long time to come back down to earth and it never stopped doing flips once it came back.
I found the same behavior driving the f1-02 at higher speed (300km/h) downhill:
Nürburgring, between Flugplatz and Schwedenkreuz, Fuchsröhre
Road Atlanta: downhill before Start
Mosport: behind Clayton Corner and behind Quebec Corner
Australian Countryside: first jump downhill (also 360)

Typical: very long fly in the air, sometimes, when touching the track again, a long slide on the roof or side over hundreds of meters.

vdrift-2009-15-06 imac intel