Skip to content

Software application

Giorgio Liggio edited this page Oct 28, 2020 · 1 revision

The application can be executed from the terminal with the following commands:

$ g++ src/* -o App -I ./includes -lGL -lglfw -ldl -lassimp -I ./includes/bullet/ ./includes/bullet/BulletDynamics/libBulletDynamics.a ./includes/bullet/BulletCollision/libBulletCollision.a ./includes/bullet/LinearMath/libLinearMath.a `pkg-config --cflags --libs gtk+-3.0`
$ ./App

On start, the application features two windows: the main window, where the simulation and the drawing functions are executed, and the settings panel, that expose a graphic interface to interact with the main application.

Main window

The main window

The main window looks minimal, for it is used mainly for rendering purposes, and it shows the car controlled by the user from a given angle. The user can rotate the virtual camera around the car, as well as zooming in and out, or detach it and move around freely. The keyboard is the main input device for controlling the car movement and can be used to move the camera too combined with the mouse.

Controls

Car controls:

  • ARROW UP: throttle
  • ARROW DOWN: brake/reverse
  • ARROW LEFT/RIGHT: turn left/right
  • SPACEBAR: handbrake
  • R: angular torque (flip car)
  • T: linear upward torque (jump car)
  • ESCAPE: quit

Camera controls:

  • W/A/S/D: move camera
  • MOUSE LEFT BUTTON + MOVE MOUSE: rotate the camera around the car (when in follow mode)
  • MOUSE WHEEL: zoom in/out (when in follow mode)
  • TAB: switch between “free camera” and “follow camera” mode

Settings panel

Settings panel preview

The settings panel shows a graphic user interface useful to change some simulation variables in real-time. The values influence how the car will behave when driven around, like its acceleration, handling, grip, weight, and so on.

Each widget is described by a label with its function or effect; sliders have marks to give information about the effect achieved.

Vehicle mass

This trackbar allows for changing the car’s mass. The heavier the car is, the more stable it is when driving, but it will require more force to accelerate.

Suspension stiffness

This factor indicates how powerful the suspensions are. A small value stands for a light balance force, and a great value means suspensions apply a higher force when stressed.

Suspension damping

This value represents the “softness” of the suspensions, regardless of their stiffness value. Due to Bullet’s internal management of constraints, a small value gives a soft suspension system, and great values lead to a spring-like behaviour.

Tyre friction coefficient

The wheel grip with the ground is conditioned by this value. Great values increase the traction, while small values will make the car drift when braking or turning.

Tyre steering angle

This is the steering angle limit when turning left or right. The greater the value, the more sensible the steering wheel is. A value equal to 0 means the car will not turn.

Acceleration power

Since the engine is modelled as torques applied to the wheels, this value is the magnitude of such rotational force. Great values accelerate the car more quickly.

Stability assist

This slider influences the level of the simulation, thus how much realistically the car behaves. In certain conditions, one can lose control of the vehicle, but this is not supposed to happen when playing video games; this controller alters the overall damping of the car, resulting in a helping stability effect. This must be seen as a “tweak” option rather than an actual car parameter.

Presets

All the previous sliders can be freely changed by the user, but there are ready-made settings as well.

  • Normal: generic settings, resulting in a common vehicle experience;
  • Muscle: settings suitable for a muscle car setup;
  • Pimp: the car will wiggle very often;
  • Sport: ideal setting for driving fast, with a high grip.