UAV Simulation Pro is a high-performance, web-based Unmanned Aerial Vehicle (UAV) flight simulator. It combines a realistic 3D visualization engine built with Three.js and a robust physics core powered by Rust and WebAssembly (WASM).
- Hybrid Architecture: Physics calculations are offloaded to a high-performance Rust backend compiled to WASM, while rendering is handled by the browser's GPU via WebGL.
- Realistic Rendering: Custom 3D drone models with rotating propellers, dynamic lighting, and shadows.
- Physics Engine: State-aware physics simulation including gravity, thrust, inertia, and PID-based hover stabilization.
- Modern HUD Interface: A "Glassmorphism" style Head-Up Display (HUD) showing real-time telemetry:
- Altitude & Speed with dynamic bar charts.
- System Status monitoring.
- Mission Timer.
- Hot Reloading: Seamless development experience with Vite and
vite-plugin-wasm.
- Frontend:
- Vite (Build Tool)
- TypeScript
- Three.js (3D Library)
- CSS3 Variables & Flexbox for UI
- Backend (Simulation Core):
- Rust
- wasm-bindgen
- serde (Serialization)
- Node.js (v18+ recommended)
- Rust (Latest stable toolchain) &
cargo - wasm-pack (
cargo install wasm-pack)
git clone <repository-url>
cd uav-simulation-pronpm installYou must compile the Rust code before running the app.
npm run build:wasmStart the development server.
npm run devOpen your browser at http://localhost:5173.
uav-simulation-pro/
├── crate-wasm/ # Rust Source Code (Physics Engine)
│ ├── src/
│ │ ├── lib.rs # Core Simulation Logic (UavSimulation struct)
│ └── Cargo.toml # Rust Dependencies
├── src/ # Frontend Source Code
│ ├── engine/ # 3D Specific Code
│ │ ├── DroneModel.ts # Three.js constructions
│ │ └── SceneSetup.ts # Camera & Lights
│ ├── main.ts # Entry Point (Loop & WASM Binding)
│ └── style.css # HUD Styling
├── index.html # Main HTML Layout
├── package.json # Node Dependencies & Scripts
└── vite.config.ts # Vite Configuration
Currently, the simulation runs in Autonomous Hover Mode.
- The drone attempts to maintain a target altitude of 5.0 meters.
- The Rust physics engine applies gravity and counter-thrust forces in real-time.
- The PID controller stabilizes the ascent/descent.
This project is open-source and available under the simple Sandbox license.