Expand description
Input handling for viewport-lib: a replaceable layer, not baked-in core.
The design intent is that a consumer can bring their own. Input handling splits into two halves, and either is usable on its own:
- Resolve:
input::ViewportInputturnsViewportEvents into a singleActionFrameper frame. - Apply: a camera controller takes that
ActionFrameand a&mut Cameraand produces a new pose. This is the half a custom controller replaces; seeCameraController.
The built-in controllers (orbit, first/third-person, turntable, the flat
2D camera, and the dt-driven animator) are the batteries-included
defaults. The winit/egui adapters that translate native
events are optional features (winit-adapter, egui-adapter), so the crate
builds with no framework dependency by default.
This crate carries no wgpu and no renderer. It stands on
viewport-lib-types (the input vocabulary and the Camera type) plus glam.
viewport-lib re-exports it, so viewport_lib::OrbitCameraController and
friends keep working.
Modules§
- controllers
- The batteries-included camera controllers. Camera controllers: orbit, first-person, third-person, turntable, a flat 2D camera, and fly-to animation.
- input
- The event resolver, the legacy query model, and the native-event adapters. Input system: action-based input mapping with mode-sensitive bindings.
- prelude
- The input types most code reaches for, in one glob import:
use viewport_lib_input::prelude::*;.
Structs§
- Camera
- The viewport camera: where it is, how it projects, and how it exposes.
- Look
Angles - A look direction as yaw and pitch, Z-up.
Traits§
- Camera
Controller - A camera controller: the “apply” half of input handling.