# brihernandez/mouseflight architecture

> Architecture diagram of the GitHub repository brihernandez/mouseflight, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/brihernandez/mouseflight
- Repository: https://github.com/brihernandez/mouseflight

## Overview

Mouse Flight is a Unity aircraft-control component and demo. The principal workflow is that a player points with the mouse, the controller derives a world-space aim position, and the aircraft implementation steers toward it; the HUD can display that aim and the aircraft’s boresight. The rig separates mouse-driven pointing from smooth camera motion. No source excerpts were provided, so the relationships below are limited to those documented in the README.

Main entry points: [`Assets/MouseFlight/Scripts/MouseFlightController.cs`](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Scripts/MouseFlightController.cs) (Flight Controller), [`Assets/MouseFlight/Prefabs/MouseFlightRig.prefab`](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab) (Camera Rig), [`Assets/MouseFlight/Demo/Scripts/Plane.cs`](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Scripts/Plane.cs) (Demo Plane Logic), [`Assets/MouseFlight/Demo/Scripts/Hud.cs`](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Scripts/Hud.cs) (Demo HUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Mouse Control"]
  node_controller["Flight Controller"]
  node_aircraft["Aircraft Reference"]
end

subgraph group_rig["Camera Rig"]
  node_aim["Mouse Aim"]
  node_camera_rig["Camera Rig"]
  node_camera["Camera"]
end

subgraph group_demo["Aircraft Demo"]
  node_demo_plane["Demo Plane Logic<br/>[Plane.cs]"]
  node_plane_prefab["Plane Prefab<br/>[Plane.prefab]"]
  node_hud["Demo HUD<br/>[Hud.cs]"]
  node_hud_prefab["HUD Prefab"]
end

node_player(("Player"))

node_player -->|"points with mouse"| node_controller
node_player -->|"uses overrides"| node_controller
node_controller -->|"rotates"| node_aim
node_camera -->|"orients relative"| node_aim
node_controller -->|"aims camera"| node_camera_rig
node_camera_rig -->|"smoothly rotates"| node_camera
node_controller -->|"follows reference"| node_aircraft
node_controller -->|"provides aim position"| node_demo_plane
node_demo_plane -->|"steers toward aim"| node_aircraft
node_controller -->|"provides aim and boresight"| node_hud

click node_controller "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Scripts/MouseFlightController.cs"
click node_aim "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab"
click node_camera_rig "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab"
click node_camera "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab"
click node_aircraft "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab"
click node_demo_plane "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Scripts/Plane.cs"
click node_plane_prefab "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Prefabs/Plane.prefab"
click node_hud "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Scripts/Hud.cs"
click node_hud_prefab "https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Prefabs/MouseFlightHud.prefab"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_aircraft toneBlue
class node_aim,node_camera_rig,node_camera toneAmber
class node_demo_plane,node_plane_prefab,node_hud,node_hud_prefab toneMint
class node_player toneIndigo
```

## Components

### Mouse Control

- [Flight Controller](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Scripts/MouseFlightController.cs): `Assets/MouseFlight/Scripts/MouseFlightController.cs`
- [Aircraft Reference](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab): `Assets/MouseFlight/Prefabs/MouseFlightRig.prefab`

### Camera Rig

- [Mouse Aim](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab): `Assets/MouseFlight/Prefabs/MouseFlightRig.prefab`
- [Camera Rig](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab): `Assets/MouseFlight/Prefabs/MouseFlightRig.prefab`
- [Camera](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Prefabs/MouseFlightRig.prefab): `Assets/MouseFlight/Prefabs/MouseFlightRig.prefab`

### Aircraft Demo

- [Demo Plane Logic](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Scripts/Plane.cs): `Assets/MouseFlight/Demo/Scripts/Plane.cs`
- [Plane Prefab](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Prefabs/Plane.prefab): `Assets/MouseFlight/Demo/Prefabs/Plane.prefab`
- [Demo HUD](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Scripts/Hud.cs): `Assets/MouseFlight/Demo/Scripts/Hud.cs`
- [HUD Prefab](https://github.com/brihernandez/mouseflight/blob/master/Assets/MouseFlight/Demo/Prefabs/MouseFlightHud.prefab): `Assets/MouseFlight/Demo/Prefabs/MouseFlightHud.prefab`

### Other components

- **Player**

## Connections

- Player → Flight Controller: points with mouse (evidence: `README.md`)
- Player → Flight Controller: uses overrides (evidence: `README.md`)
- Flight Controller → Mouse Aim: rotates (evidence: `README.md`)
- Camera → Mouse Aim: orients relative (evidence: `README.md`)
- Flight Controller → Camera Rig: aims camera (evidence: `README.md`)
- Camera Rig → Camera: smoothly rotates (evidence: `README.md`)
- Flight Controller → Aircraft Reference: follows reference (evidence: `README.md`)
- Flight Controller → Demo Plane Logic: provides aim position (evidence: `README.md`)
- Demo Plane Logic → Aircraft Reference: steers toward aim (evidence: `README.md`)
- Flight Controller → Demo HUD: provides aim and boresight (evidence: `README.md`)
