Skip to content

Fly your drone around the city and deliver all the packages! Beware: crashing into the buildings is easier than you think!

License

Notifications You must be signed in to change notification settings

carloronconi/drone-delivery

Repository files navigation

Drone delivery

Fly your drone around the city and deliver all the packages! Beware: crashing into the buildings is easier than you think!

Computer Graphics course - MSc Computer Science and Engineering @ Polimi.

Usage

Vulkan and CMake are required.

  1. Clone the repository;
  2. Open a terminal and run the following commands:
   cd drone-delivery 
   cmake .
   make 
   ./drone-delivery

If you're using a modern code editor, when opening the project folder it should be automatically recognised as a CMake project. In that case you can skip step number 2: just press the "run" button and you're good to go!

Features

Physics engine

Plane flight is simulated using a simple physics engine. The plane is controlled using WASD and arrow keys to control throttle, roll, pitch and yaw. The physics engine implements:

Package-dropping is implemented in a similar way, but disregards rotations and lift.

Collision detection & reaction

Collision detection is vertex & height based. First, if the plane's height is below 0, a GROUND collision is detected. Otherwise, we find the vertex mesh with the highest y among those within a certain circular x, z radius from the plane. If its height is greater than the plane's, a MESH collision is detected.

Collision reaction depends on the type of collision that was detected. In case of GROUND collision, the plane is simply kept above ground and its yaw is preserved, while all other rotations are zeroed. In case of MESH collision, the plane is "bounced" back in the opposite direction of its speed.

Dynamic camera view

The camera allows for two modes: the classic follow camera and a stationary camera on the landing strip, pointed to the plane. The camera is damped during each of the two states and during the switch, creating a smooth transition between the two.

Custom pipelines with dynamic day/night modes

A total of 5 custom pipelines exist, each implementing a different vertex-fragment shader couple. Complete list of the pipelines:

  • Overlay: splash screens and text/symbol overlay during game;
  • Metallic: plane and arrow;
  • Opaque: city blocks;
  • Emit: roads with lampposts;
  • Animation: propellers.

Some pipelines implement instanced-rendering to draw more instances of the same model in different positions without needing to store a different model for each. This is how the road tiles or the packages on the overlay are rendered.

License

MIT license

About

Fly your drone around the city and deliver all the packages! Beware: crashing into the buildings is easier than you think!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages