Big Car Vehicle Setup

Big Car Vehicle Setup

hello,I have a question in Vehicle Setup.

I studied the demo in SDK of Car,The demo use program data created a chassisShape,I test to execute it have no program.

Then,I modi the chassisShape data to scale Volume of car to 10xzoom,now the car length is 40.0f,width is 20.0f, height is 10.0f,mass is 7500

So I continue change many Parameter to diffurent value in VehicleSetup.cpp,

include :

Wheel:

wheel.radius = 3.0f;
wheel.width = 2.0f;
wheel.mass = 100.0f;

engine:

engine.maxTorque = 8000.0f;

 engine.minRPM = 10000.0f;
 engine.optRPM = 35000.0f;

 engine.maxRPM = 75000.0f;

transmission:

transmission.downshiftRPM = 35000.0f;
transmission.upshiftRPM = 65000.0f;

suspension:

hardPointFrontX = 8.8f;
hardPointBackX = -8.8f;
hardPointY = -0.2f;
hkReal hardPointZ = 8.8f;

but the car always fly and fly,or Still.

Can U give me a Vehicle setup parameter list  table of the 10xzoom big than the car demo?3Q

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi hotrinfall,
In general, the vehicle kit was designed so that it's fine tuned to common vehicle cases. Creating a huge car that is 10 times the demo car is possible, but some of the vehicle solving code might not work as expected out of the box. Some of the vehicle parameters specifically will require some fine-tuning.

In general, a different approach you can take is just rendering the car 10 times bigger, depending on how you want this giant car to interact with your physics world.

Concerning the parameters and how to modify them, here's a starting point:

1) Change the chassis mass in the demo to 4000 kg.
    Havok Physics is designed with internal constants that assume that the range of masses of dynamic bodies isn't huge. This is an assumption for stable constraint solving and a mass of 4000 is already pretty big for a complicated constraint system like a car.

2) Change VehicleApiUtils::createCarChassisShape increazing all sizes by 10 times like follows:
    hkReal xSize = 17.5f;
    hkReal ySize = 2.5f;
    hkReal zSize = 11.0f;

    hkReal xBumper = 19.0f;
    hkReal yBumper = 1.5f;
    hkReal zBumper = 10.0f;

    hkReal xRoofFront = 4.0f;
    hkReal xRoofBack = -10.0f;
    hkReal yRoof = ySize + 4.5f;
    hkReal zRoof = 7.0f;

    hkReal xDoorFront = xRoofFront;
    hkReal xDoorBack = xRoofBack;
    hkReal yDoor = ySize;
    hkReal zDoor = zSize + 1.0f;
So that the shape itself is 10 times bigger.

3) Change the center of mass position so that it reflects the shape changes in the CarDemo.
    chassisInfo.m_centerOfMass.set( -0.37f, 1.43f, 0.0f);

4) Change the engine parameters in VehicleSetup.cpp like follows:
    engine.m_maxTorque = 5000.0f;

5) Change the transmission parameters in VehicleSetup.cpp like follows:
    const hkReal vehicleTopSpeed = 300.0f; // Not 10 times, would be too fast.
    const hkReal wheelRadius = 4.0f;
    
6) Change the breaking parameters in VehicleSetup.cpp like follows:
    const float bt = 15000.0f;
    
7) Change the suspension parameters in VehicleSetup.cpp like follows:
    suspension.m_wheelParams[0].m_length = 3.5f;
    suspension.m_wheelParams[1].m_length = 3.5f;
    suspension.m_wheelParams[2].m_length = 3.5f;
    suspension.m_wheelParams[3].m_length = 3.5f;
    const hkReal hardPointFrontX = 13.0f;
    const hkReal hardPointBackX = -11.0f;
    const hkReal hardPointY = -0.5f;
    const hkReal hardPointZ = 11.0f;
    
    And also:
    
    const float str = 10.0f; 
    const float wd = 0.1f; 
    
    Strength and damping of the suspension doesn't really represent what intuitively you would think, they are applied during vehicle solving depending on the wheel and chassis mass and obtaining good values is a matter of trial and error.
    
8) In the createDisplayWheels demo function, change the default parameters to:
    virtual void createDisplayWheels(hkReal radius = 4.0f, hkReal thickness = 2.0f);
    
9) Change VehicleApiUtils::createCamera() like:
    cinfo.m_set[0].m_positionUS.set( -60.0f, 15.0f, 0.0f); 
    cinfo.m_set[1].m_positionUS.set( -60.0f, 15.0f, 0.0f); 
    cinfo.m_set[0].m_lookAtUS.set ( 20.0f, 0.0f, 0.0f );
    cinfo.m_set[1].m_lookAtUS.set ( 20.0f, 0.0f, 0.0f );

10) Change VehicleSetup::setupVehicleData() like follows
    // This value is also used to calculate the m_primaryTransmissionRatio.
    data.m_wheelParams[i].m_radius = 4.0f;
    data.m_wheelParams[i].m_width = 2.0f;
    data.m_wheelParams[i].m_mass = 100.0f;
    data.m_wheelParams[i].m_viscosityFriction = 0.25f;
    data.m_wheelParams[i].m_maxFriction = 20.0f * data.m_wheelParams[i].m_friction;
    data.m_wheelParams[i].m_forceFeedbackMultiplier = 0.1f;
    data.m_wheelParams[i].m_maxContactBodyAcceleration = hkReal(data.m_gravity.length3()) * 20;

And the result is a giant car as you would expect. Which is really hard to drive as the friction solving for the wheels and the very heavy chassis will generate very strong impulses in the solver, rendering the simulation relatively unstable.

Hope this helps!
Daniele

Try not to become a man of success, but rather try to become a man of value.

o,3Q,the car can runing,but jump and jump,I change its mass to 3500.

Leave a Comment

Please sign in to add a comment. Not a member? Join today