48 releases (24 breaking)

0.25.0 Mar 28, 2025
0.23.0 Feb 20, 2025
0.21.2 Dec 23, 2024
0.20.1 Nov 21, 2024
0.6.1 Jul 14, 2023

#47 in Game dev

Download history 871/week @ 2024-12-13 482/week @ 2024-12-20 192/week @ 2024-12-27 523/week @ 2025-01-03 658/week @ 2025-01-10 708/week @ 2025-01-17 612/week @ 2025-01-24 913/week @ 2025-01-31 821/week @ 2025-02-07 1068/week @ 2025-02-14 900/week @ 2025-02-21 815/week @ 2025-02-28 585/week @ 2025-03-07 856/week @ 2025-03-14 687/week @ 2025-03-21 566/week @ 2025-03-28

2,775 downloads per month
Used in 23 crates (21 directly)

MIT/Apache

68KB
1K SLoC

Crates.io docs.rs Bevy tracking

Bevy Pan/Orbit Camera

A screen recording showing camera movement

Summary

Bevy Pan/Orbit Camera provides orbit camera controls for Bevy Engine, designed with simplicity and flexibility in mind. Use it to quickly prototype, experiment, for model viewers, and more!

Features:

  • Smoothed orbiting, panning, and zooming
  • Works with orthographic camera projection in addition to perspective
  • Customisable controls, sensitivity, and more
  • Touch support
  • Works with multiple viewports and/or windows
  • Easy to control manually, e.g. for keyboard control or animation
  • Can control cameras that render to a texture

Controls

Default mouse controls:

  • Left Mouse - Orbit
  • Right Mouse - Pan
  • Scroll Wheel - Zoom

Default touch controls:

  • One finger - Orbit
  • Two fingers - Pan
  • Pinch - Zoom

Quick Start

Add the plugin:

.add_plugins(PanOrbitCameraPlugin)

Add PanOrbitCamera (this will automatically add a Camera3d but you can add it manually if necessary):

commands.spawn((
    Transform::from_translation(Vec3::new(0.0, 1.5, 5.0)),
    PanOrbitCamera::default(),
));

This will set up a camera with good defaults.

Check out the advanced example to see all the possible configuration options.

Cargo Features

  • bevy_egui (optional): Makes PanOrbitCamera ignore any input that egui uses, thus preventing moving the camera when interacting with egui windows

Version Compatibility

bevy bevy_panorbit_camera
0.15 0.21-0.25
0.14 0.19-0.20
0.13 0.14-0.18
0.12 0.9-0.13
0.11 0.6-0.8
0.10 0.1-0.5

Credits

License

All code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.

Dependencies

~42–80MB
~1.5M SLoC