An open API service indexing awesome lists of open source software.

https://github.com/spicycactuar/basic-flight

Basic arcball-like flight simulator
https://github.com/spicycactuar/basic-flight

computer-graphics cpp matrix-transformations opengl qt5 render-loop

Last synced: about 1 month ago
JSON representation

Basic arcball-like flight simulator

Awesome Lists containing this project

README

          

# Basic Flight

![basic-flight](https://github.com/user-attachments/assets/1e457f28-ac3e-4172-8f80-ef44ef4a60af)

Simple flight simulation application showcasing basic arcball-like physics and sphere collisions. Built using Qt and rendered with OpenGL immediate mode.

The bulk of the logic consists of rendering the scene from the plane's perspective. By keeping track of its `position` and `rotation`, the Camera View matrix is consstructed as follows:

$C = R^T * -T$

Plane collisions against lava bombs are Point-Sphere intersection tests. For the floor a distance with an epsillon is checked.

## Project Structure

```plaintext
basic-flight/
├── src/ # Source code
├── assets/ # Static assets (.tri and .dem files)
├── basic-flight.pro # QMake project
└── README.md # Project README
```

## Build

```bash
qmake
make
```

## Run

```bash
bin/basic-flight
```

Example:

```shell
bin/basic-flight -33000 3000 2000
```

## Controls

| Key(s) | Action |
|-------------------------|---------------------------------------|
| `A` / `S` | Pitch down and up by 3° |
| `Q` / `E` | Roll left and right by 3° |
| `W` / `D` | Yaw left and right by 3° |
| `+` / `-` | Increase and decrease |
| `X` | Close the application |

## Technologies

* **C++**: `>= C++17`
* **Qt**: `5.12.x`
* **OpenGL**: `>= 4.0`

Newer versions of Qt might work correctly, if no breaking changes that affect the application were introduced.