Vehicle Physics question

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
RayBatts
Posts: 4
Joined: Mon Nov 08, 2010 7:36 pm

Vehicle Physics question

Post by RayBatts »

My associates and I have noticed a bit of odd behavior in vehicle physics.

To easily replicate this, open up/run the SuspensionCarDemo2.cs filie (Though any demo with a car should do it) in the Extras folder. In the constructor, set the Space.ForceUpdater.Gravity property to Vector3.Zero then run the demo.

As expected, the car is suspended in mid air. The curious behavior is that accelerating the vehicle/spinning the wheels causes the entire vehicle to slowly spin as well. I'd expect for the wheels to be able to spin without transferring that rotational velocity to it's attached body. Is this a consequence of multiple constraints fighting each other? Is there a better solution than "Lower the motor settings until it doesn't happen anymore"?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Vehicle Physics question

Post by Norbo »

Assuming I am seeing the same thing you are, this is actually physically correct behavior. In order to spin a wheel, an equal and opposite torque must be applied to the car. This would be visible on a real car as well.

In order to stop it from happening, you would need to introduce a nonphysical hack. For example, instead of moving the wheels with two-entity motors, just apply angular impulses directly to the wheel. I would not recommend doing this, though.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Vehicle Physics question

Post by Norbo »

I should mention that the Vehicle class itself will not exhibit this behavior, because the Vehicle class does not have physical wheels. Its 'wheels' are just queries that find surfaces to use as supports.
Post Reply