Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

PhysX and vehicles

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone here using PHysX to do vehicles? I am using 2.7.3 and the wheel tutorials from the 700 series IMO have some issues. If you drive the car around and speed up enough, the wheels will move forward and leave the axle, but when stop they move back to their initial position? Anyone have any ideas why? Or how to fix this.

Share this post


Link to post
Share on other sites
Advertisement
as with all physics engines, you will need to use a harder joint between the wheels and the axles. a softer joint allows the wheels to be slightly away from the axles, and you don't really want that. Its going to be one of the properties of the joint object, although I've never used PhysX.

You may also want to consider using a "ray cast vehicle" instead, whereby each wheel has a ray going down which measures where the ground is in relation to the top of the suspension. The wheels are then drawn as non collision objects. This gives less realistic results, but higher performance and greater simplicity. Racing games in the 90's typically used this system, and its the system used in GTA3 and subsequent games.

Share this post


Link to post
Share on other sites
Thanks for the reply, myself I haven't setup any joints, the SDK has a wheel shape and that is what I am using. I create 4 wheels and attached my vehicle body to it.

Share this post


Link to post
Share on other sites
You may find that there is a specific tolarence variable you need to set on the axle joints. Can you access the object/joint heirarchy of the actor?
The global tolerance level for joints may be too lax for wheels on a car, since its not expected that wheels will fly off at any time. You may need to modify a variable on the axle joints to ensure its constrained properly. This require extra processing power, I believe, so it may be quite loose by default.

The alternative is not to draw the wheels based on the position of the "wheel bodies" but rather jut draw a wheel where the wheels are "supposed" to be, and leave the actual wheels on the simulation to do whatever they want, including get ahead of the vehicle.

I don't use PhysX, I use ODE, so I can't tell you any more than that.

p.s. ITs good to see you use tabs in your code. Fight the good fight!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!