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!
Default controls:
Add the plugin:
rust ignore
.add_plugin(PanOrbitCameraPlugin)
Add PanOrbitCamera
to a camera:
rust ignore
commands
.spawn((
Camera3dBundle::default(),
PanOrbitCamera::default(),
));
This will set up a camera with good defaults.
Optionally configure settings:
rust ignore
commands
.spawn((
Camera3dBundle::default(),
PanOrbitCamera {
beta: TAU * 0.1,
radius: 5.0,
},
));
Check out the advanced example to see all the possible options.
alpha
and beta
?Think of this camera as rotating around a point, and always pointing at that point (the focus
). The sideways rotation,
i.e. the longitudinal rotation, is alpha
, and the latitudinal rotation is beta
. Both are measured in radians.
If alpha
and beta
are both 0.0
, then the camera will be pointing directly forwards (-Z direction). Increasing
alpha
will rotate around the focus
to the right, and increasing beta
will move the camera up and over the focus
.
bevy_egui
: makes PanOrbitCamera ignore input when interacting with egui widgets/windows| bevy | bevypanorbitcamera | |------|----------------------| | 0.10 | 0.1-0.4 |
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.
Pull requests are welcome! By contributing code to this repository you agree to license it under the dual MIT+Apache license as detailed above.