PhysX and Simple Vehicle Physics

Started by
0 comments, last by mpenney 15 years, 5 months ago
Hi all, A bit of a PhysX newbie here. I've been having some problems on implementing basic vehicle physics with the PhysX library... I've implemented a vehicle, and it seems to apply engine torque just fine in moving forward and backwards. However when I set a turning angle on the front wheels to turn, the vehicle just kind of drifts off in that direction while moving in the direction it was before (so in this case, the base orientatin direction). It looks like it does orient itself *somewhat* (although VERY little) over time, but it just straight up looks silly. The movement (ie. position) through space seems to be mostly correct, but the orientation doesn't reflect the fact that its turning or anything at all (just remains straight). After looking at countless threads and trying to make sense of the (seemingly vague) PhysX documentation, my theory is that the wheels are experiencing too much slip... I've tried tweaking longitudinalTireForceFunction and lateralTireForceFunction's stiffness factor and increased the surface friction coefficient to no avail. I bet it's probably something really simple I'm overlooking, but I'm tearing my hair out trying to figure it out. (Also, if it makes a difference, I'm using Ogre and PhysX- no NxOgre) I haven't had a physics class for a good long time so forgive my probably terrible physics explanations :D
Advertisement
Doh!

After looking at my code a little more I realized I hadn't set a center of mass, and that the center of mass that was automatically being calculated was all wonky. The vehicle now moves with its turns as it probably should... the only issue now is that the back wheels don't really remain rigid with the body of the car as they should.

This topic is closed to new replies.

Advertisement