Bouncing vehicle

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
sfxman
Posts: 15
Joined: Sat Sep 18, 2010 1:28 am

Bouncing vehicle

Post by sfxman »

Hello,

I'm working on a project that uses a vehicle with the raycast wheels.
I setup something similar to the windows phone sdk vehicle sample (same bodies and wheels). The ground is a box.

My problem is that when the wheels touch the ground, they bounce up pretty violently up (i'm outputing the translation of the transformation matrix) and it looks like it causes the car to react and bounce indefinitely... It feels like the spring is either completely relaxed of completely compressed, no middle values...
The stiffness, damping, rest length, compound bodies dimensions, masses are exactly the same as the demo... yet it bounces for me...

The simulation is otherwise pretty stable judging by another test of a cube/box that settles on the same ground with no issues...

Do you guys have any idea what could be causing this bouncing in my code and not in the demo?

Thanks!
Matt
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Bouncing vehicle

Post by Norbo »

My first guess would be size issues with whatever the car is trying to drive on, however that should also affect the other entity's collision behavior on the ground.

The engine likes things being fairly normally sized, with dimensions around 0.5 to 10 units per entity. That's not a strict requirement (sizes outside of that range should work fine until things get really extreme), but its a very safe guideline. That guideline applies also to individual triangles in triangle meshes/terrains, if that is what the ground is.

You could verify that it's related to size issues by dropping the car on a box with dimensions 10x1x10. If it still acts wonky, then something else is up.
sfxman
Posts: 15
Joined: Sat Sep 18, 2010 1:28 am

Re: Bouncing vehicle

Post by sfxman »

Hello Norbo,

Thanks for your reply, in fact, I was coming here to give more information :)

I found out what the problem was, it turns out that if I change my ground entity from a box to a triangle, the problem goes away completely...
Perhaps it's a bug?

On an unrelated note, do you have an ETA on the release of BEPU for XNA 4.0 RTM?

Thanks for your work :)
Matt
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Bouncing vehicle

Post by Norbo »

So far, the only way I've been able to replicate it is with a sufficiently large box. It is expected behavior once things get a little too hairy numerically for the iterative system involved.

A 100x1x100 box can sometimes cause what you described, though it becomes progressively rarer as the sizes become more normal (couldn't see it happening at 50x1x50). v0.15.0 (or the subsequent version) is going to include some robustness and speed improvements to the general raycaster and other related systems as well.
On an unrelated note, do you have an ETA on the release of BEPU for XNA 4.0 RTM?
Very soon- right now, I'm just making sure that any last minute bug candidates are caught before pushing out v0.14.2.
sfxman
Posts: 15
Joined: Sat Sep 18, 2010 1:28 am

Re: Bouncing vehicle

Post by sfxman »

That's interesting, the box I was creating was exactly 1000x1x1000 :)

Thanks for the details about the new version, I'm very much looking forward to it!

--
Matt
Post Reply