# Really realistic autosim on PhysX

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

## Recommended Posts

Hi) I need to translate the big project, realistic autosim, from ODE to PhysX. When i begun my research of PhysX, I faced the serious problem. The car consist of: box and 4 capsules, attached through revJoints. The car near velocity beside 50 raises the front part. Regardless of drive(front,back,4wd). If displace the center of gravity or put pressing power, then speed limit it increases to 100, but on achievement of this velocities machine behaves extremely sloppy. I know the many people, faced this problem, but not been able to find the decisions. We all shall be grateful for help! :-)

up

##### Share on other sites
Perhaps instead of simply using a box and 4 wheels, you could accurately model a real car - with things like anti-sway bars etc...

If real cars were just a box with 4 wheels, they would lift off the ground when accelerating or roll over when going around corners as well. Mechanical engineers have created more complex chassis designs (in real life) to avoid these problems - a simulated car will need to solve the same problems, so you should look at how they are solved in real life.

##### Share on other sites
Possible... Do You known some decisions in PhysX?

##### Share on other sites
The 'best' way of modelling a vehicle in my experience is not to try and create physical objects for the wheels, but rather to use a 'raycasting' technique to project the wheel positions from attach points on the chassis.

This technique works for any physics engine, and requires only the chassis of the car to be modelled as a real physics object, with the tire and suspension forces computed separately by your own code.

For each wheel you fire a ray downwards from the chassis to compute the intersection point of the ground underneath it. From this you can compute the suspension forces and apply these back to the chassis physics object. Tire forces are found by keeping track of the wheel orientation and direction and computing lateral and longitudinal forces in the wheels local space which are again applied back to the chassis physics object.

There's quite a lot more to it than that, but that's the basic idea.

If you'd like to learn more, I'd recommend taking a look at some example code that implements this. One example would be in Erwin's Bullet Physics library. Search the code for btDefaultVehicleRaycaster. This code is obviously not using PhysX, but the techniques are easily portable, as it all boils down to just applying forces to a single physics object.

This is pretty much the standard technique used by every commercial racing game out there, and gives much more stable and accurate results than trying to model the wheels as real physics objects.

##### Share on other sites
In many games which use raycast wheels, I saw the effect of the submersion wheels in border, that not acceptable for realistic project.
Besides, I heard that raycast-lavaliere does not give such realistic physics, as completely physical wheels with joints. Does PhysX suites for making autosim games?

##### Share on other sites
Quote:
 Original post by TopSpaceIn many games which use raycast wheels, I saw the effect of the submersion wheels in border, that not acceptable for realistic project.

There are solutions - for example, use multiple rays, or do a swept cylinder test (for comparison, the ray is just a swept point test).

Quote:
 Besides, I heard that raycast-lavaliere does not give such realistic physics, as completely physical wheels with joints. Does PhysX suites for making autosim games?

You should test for yourself, I think, else you may make a judgement based on somebody elses imperfect implementation. You need to decide what you want:

1. realistic simulation of each individual component in a car - bearing in mind that a small error in your component understanding/implementation, or a missing component, or an inaccuracy in the physics engine, may result in the final behaviour being very different from reality. In addition, realistic simulation of the car, as observed by the user.

2. realistic simulation of the car, as observed by the user.

Simulating the components won't necessarily make a more realistic car simulation. Also, if the only way to change the car behaviour is to do things like increase the brake fluid pressure... that is going to make adjusting the parameters extremely hard in order to get realistic car behaviour.

[Edited by - MrRowl on October 5, 2007 3:59:05 AM]

##### Share on other sites
The hardest part of creating a car simulation is, by far, simulating the tires. You can make a decent first pass using a "box" for the chassis (with proper mass+inertia tensor WRT engine and tires) and raycast for the wheels/tires, tested on a flat plane or simple terrain. If you can make such a simulation reasonably accurate to simulate a real car, improving the wheel/tire collision method is relatively easy.

##### Share on other sites
Stiffen the suspensions at the back wheels? If they are too soft, the front will lift of, you will loose front grip and steering and the car will handle like a boat. Add aerodynamics (even a small amount) to push the front and back down at high speeds to increase the grip.

1. 1
2. 2
Rutin
20
3. 3
khawk
16
4. 4
A4L
14
5. 5

• 11
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633756
• Total Posts
3013710
×