Car


Car is a set of ready-to-use car physics layouts.

While you can setup the physics layout of a car by attaching wheels to a RigidBody, using the Car object is much more productive.

Car physics can be fully configured on a convenient unique dialog and special simulation-damping parameters allow you to 'filter-out' certain annoying behaviors, like excessive tendency to flip-over or loose traction.

Additional parameters are also provided in a car-model-specific .ini file, which defines the basic parameters, like car-body and wheel masses, that differentiate each car type in the library.

Each pre-made car layout comes with draft visible geometry which is a mere placeholder.

You can hide the placeholder meshes and visualize finished geometry instead by using the SkinMesh object.




Wheel offsets and scale

All cars in the library (see Change, below) have default wheel locations and size. You can alter these by specifying X, Y, Z offsets in meters and a scaling factor (1.0 means original size).

Change

Click the Change button to access the library of available car models.

Fast rendering

If this option is checked, a faster rendering technique is used for the placeholder geometry. This will improve frame rate on slower systems, but it may reduce rendering quality.

Cast shadows

If this option is checked, the car layout will cast a volumetric shadow. This may affect frame rate on slower systems.

Refl. update rate

Set this parameter to any positive value (below 450.0) to make the placeholder geometry dynamically reflect the actual environment surrounding it.

Hide car-body geometry

If this option is checked the car-body placeholder geometry will not be rendered, run-time.

Hide wheels geometry

If this option is checked the wheels' placeholder geometry will not be rendered run-time.

Controls

You can make the car interactive by checking the box next to one or more input controls (Throttle, Reverse, Brake, Turn Left/Right).

You can allow final users of your project to configure control (eg to use a steering wheel by adding a ConfigureControls object to the project.

The Delay parameters allow you to set the response time for each control, in seconds (approximately).

Also, keep in mind that input controls must be disabled (unchecked) if you want to control the car by manipulating its internal values, for example by using the Script object. See internal values table below for more.

  • Max angle determines the maximum turning angle for the front wheels.


  • If the Working At Start option is not checked, the car will only respond to input controls when the object is started by another object, like for example EventOnInput.


  • Parameters

  • Speed is a factor that determines the maximum speed for the car. Actual speed depends on car masses, damping and other settings.
  • Acceleration determines how quickly the car will reach its top speed. Actual speed depends on car masses, damping and other settings.
  • Reverse speed, using the above factors as basis, determines the car performance when it goes reverse.
  • FWD/RWD determine whether the car is front-wheel drive, rear-wheel drive, 4-wheel drive.
  • Brakes power determines how quickly the car will stop while braking.
  • Front grip values determine rolling and lateral traction (friction) for the front wheels.
  • Rear grip values determine rolling and lateral traction (friction) for the rear wheels.
  • Suspensions values determine suspensions' strength and hardness.


  • Simulation dampers

  • Banking stabilizer is actually the center of mass displacement, in meters. For example, 0.75 means that the center of mass for the car will be 0.75 meters lower than the car-body model center. The lower the center of mass, the harder to flip the car on bends.

    NOTE: setting the center of mass too low will make the car bend the opposite way, like a motorbike, on bends. However, this effect is useful when implementing motorbikes, by altering the Car wheel X offset so that they join together in the middle.


  • Crash damping allows you to reduce car speed on collisions. The second value is the threshold speed (in meters per second) for the object hit by the car. If the object's speed is above the threshold, no damping is applied. You typically use this to prevent collisions with other cars or non-static scenery props from triggering crash damping.


  • Other dialog controls

    For information about the remaining controls, please click here.


    INTERNAL PARAMETERS


    The following internal parameters can be accessed by using other objects like EventOnValue or Script:

  • Turn left/right, between -1 and 1. Write only
  • Throttle, between -1 and 1. Write only
  • Brake, between 0 and 1. Write only
  • Speed, in meters per second. Read only
  • Maximum steering, in degrees. Read only


  • The following internal parameters can be accessed by using the Script object. Please note that resetting the Car object run-time (for example by calling the iObjectReset() script function) will not restore these parameters to their default values.

  • Top speed factor. Write only
  • Acceleration. Write only
  • Reverse (0-100). Write only
  • Brakes power. Write only
  • Brakes state. Read only. This value is 1 when the car is using the brakes, zero otherwise. Note that cars controlled by the CarAI object may almost never brake, unless the Brakes and the Driving carefulness parameters on the CarAI object dialog are bigger than zero
  • Throttle state. Read only. This value is 1 when car throttle is fully activated, zero when it is released and -1 when the car is in full reverse. Intermediate states produce intermediate values.
  • Front grip. Write only
  • Front grip (lat). Write only
  • Rear grip. Write only
  • Rear grip (lat). Write only
  • Suspensions spring. Write only
  • Suspensions damping. Write only
  • FWD mode (0 or 1). Write only
  • RWD mode (0 or 1). Write only. NOTE: when both FWD and RWD are zero, rear wheels are blocked (hand-brake).