Overview
bevy_dolly
is a prototype plugin built for the Bevy game engine. It leverages the powerful dolly
crate, developed by h3r2tic, to control camera movement within a Bevy application.
[!WARNING]
Be aware thatbevy_dolly
's API is still undergoing revisions. Feedback on its ergonomics and developer experience (DX) is highly appreciated.
Dolly and Camera Movement
It's important to know that dolly
is all about controlling how the camera moves and not changing the camera itself. This means you can use it for other things, like making a turret and its cannon move around.
Dolly operates in two essential steps:
-
Creating a Rig: Define a
Rig
with drivers that the dolly can utilize. These drivers, which can control both translation, rotation, constraints and custom behavior as abstractions. These rigs serve as tools to shape the camera's behavior and provide additional functionality. -
Marker Component: Register a marker component on both the Camera and the Rig (rig component tag). This allows you to easily switch the behavior of a camera entity by changing the associated rig component tag. To understand the process better, refer to the examples.
Understanding Drivers
Drivers are mechanisms that influence the behavior of the camera. They can represent constraints or provide additional functionality. To explore the available drivers, refer to the examples.
In your Cargo.toml
:
[]
# Your bevy dependency here ...
# bevy = "0.12"
= { = "0.0.2" }
In your Bevy App:
// The component tag used to parent to a Dolly Rig
;
In the setup system:
// In your setup system
And your runtime to update the rig:
Helper Plugins
bevy_dolly
provides some helper plugins by default, which can be removed if not needed when setting up bevy_dolly
as a dependency:
[]
= { = "0.0.2", = false }
To include the drivers back, add features = ["drivers"],
to the dependency.
Example Showcase
Explore practical examples in the examples repository.
Running Examples
If you've cloned the project and want to test, execute the following command to run the orbit
example:
Compatibility and Support
bevy | bevy_dolly |
---|---|
0.12 | 0.0.2 |
0.11 | 0.0.1 |
Alternatives
Explore other Bevy camera controllers that might suit your needs:
- bevy_fps_controller - A Fps controller with crouching, sprinting, flymode and more
- smooth-bevy-cameras - 3 Smooth Camera controllers: Fps, Orbit or Unreal
- bevy_spectator - A spectator camera controller
- bevy_flycam - A simple fly camera
- bevy_fly_camera - A advanced fly camera
- bevy_pancam - 2D Click and Drag - Style camera movement
- bevy_config_cam - Plugin that enables to use collection of different camera controllers at runtime, uses bevy_dolly as the backend
Licensing
The project is under a dual license: MIT and Apache 2.0. Feel free to contribute within the bounds of these licenses.
Contributing
Yes this project is still a WIP, so PRs are very welcome.
[!NOTE]
Note that thedolly
dependency used is a slightly patched submodule to allow for native bevy transform types. To build the crate locally, run: