# PhysX and Simple Vehicle Physics

This topic is 3600 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
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.

1. 1
2. 2
3. 3
Rutin
14
4. 4
5. 5

• 10
• 12
• 9
• 14
• 10
• ### Forum Statistics

• Total Topics
632653
• Total Posts
3007664
• ### Who's Online (See full list)

There are no registered users currently online

×