bevy_dolly
is a prototype plugin using h3r2tic's powerful crate: dolly, implemented for bevy.
âš Feedback - Bevydolly's API is still being revised, so feedback on ergonomics and DX is highly appreciated_ âš
It is important to note that dolly is a way to control the movement of the camera and thus, not the camera component itself.
Dolly requires two steps to function:
Rig
we are able to define drivers on which the dolly can enact, these drivers can both be constraints and functionality.Explain what drivers are
To read more about the different drivers.
```rs
struct MainCamera;
fn main() {
App::new()
.addplugins(DefaultPlugins)
.addstartupsystem(setup)
//..
.addsystem(Dolly::
rs
// In your setup system
fn setup(
mut commands: Commands,
) {
commands.spawn((
MainCamera, // The rig tag
Rig::builder()
.with(Position::new(Vec3::ZERO))
.with(YawPitch::new().yaw_degrees(45.0).pitch_degrees(-30.0))
.with(Smooth::new_position(0.3))
.with(Smooth::new_rotation(0.3))
.with(Arm::new(Vec3::Z * 4.0))
.build(),
Camera3dBundle::default(),
));
}
Link to examples readme
This plugin currently also provides some helper plugins, which. They are enabled by default but are not needed and can be removed when setting up bevy_dolly's dependency:
toml
[dependencies]
bevy_dolly = { version = "0.0.1", default-features = false }
Note this will also remove the bevy_dolly's extended drivers and add features = ["drivers"],
to include the drivers back.
To see how works in Bevy in practice, please look at this repository's examples.
cargo run --release --example orbit
|bevy|bevy_dolly| |---|---| |0.11| 0.0.1 |
There is a bunch of other bevy camera controllers that are worth checking out, especially if you are just starting out learning bevy:
The project is under dual license MIT and Apache 2.0, so joink to your hearts content, just remember the license agreements.
Yes this project is still very much WIP, so PRs are very welcome.
The dolly
dependency used is a slightly patched submodule, so to build the crate locally you must first run the following:
bash
git submodule update --init --recursive