bevy_lagrange
Work in progress. This crate is in active development and not subject to semver stability guarantees. APIs will change without notice between commits. Do not depend on this in production code yet.
A camera controller for Bevy that combines smooth orbit controls with event-driven camera operations — zoom-to-fit, queued animations, and a debug overlay for fit targets.

Features
- Smooth orbit, pan, and zoom with configurable limits
- Zoom-to-fit, look-at, and queued camera animations with easing
- Event-driven control with full lifecycle events for sequencing
- Orthographic and perspective projection, multi-viewport, render-to-texture
- Touch, trackpad, and
bevy_eguisupport - Debug overlay for fit targets (optional
fit_overlayfeature)
Quick Start
Add the plugin and spawn a camera:
use *;
use LagrangePlugin;
use OrbitCam;
OrbitCam automatically requires Camera3d. Out of the box you get orbit, pan, and zoom with smoothing.
Controls
Default mouse controls:
| Input | Action |
|---|---|
| Left Mouse | Orbit |
| Right Mouse | Pan |
| Scroll Wheel | Zoom |
Default touch controls:
| Input | Action |
|---|---|
| One finger | Orbit |
| Two fingers | Pan |
| Pinch | Zoom |
All controls are configurable via OrbitCam fields — buttons, modifiers, sensitivity, smoothness, and limits.
Event-Driven Camera Control
Enable the fit_overlay feature:
= { = "...", = ["fit_overlay"] }
Zoom-to-fit
Frame a target entity in the camera view:
commands.trigger;
Look at
Rotate the camera in place to face a target:
commands.trigger;
Animate to a specific orientation
Animate to a chosen yaw/pitch while framing the target:
commands.trigger;
Queued animations
Chain multiple movements into a sequence:
commands.trigger;
All operations support instant (Duration::ZERO) and animated paths with full lifecycle events for sequencing.
Cargo Features
| Feature | Default | Description |
|---|---|---|
fit_overlay |
no | Zoom-to-fit, camera animations, event-driven control, and debug overlay |
bevy_egui |
no | Prevents camera movement when interacting with egui windows |
Version Compatibility
| bevy_lagrange | Bevy |
|---|---|
| 0.0.2 | 0.18 |
Credits
- Plonq —
bevy_lagrangebuilds on bevy_panorbit_camera, with permission
License
All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.