Run a minimal implementation of the gizmo by cloning this repository and running:
cargo run --example minimal
- Prebuilt transform gizmo appears when you select a designated mesh
- Translation handles (axis, plane, and normal to camera)
- Rotation handles
- Gizmo always renders on top of the main render pass
- Gizmo is always the same size at it moves closer/further from the camera
This plugin is built on and relies on bevy_mod_picking
for 3d mouse interaction with the scene.
Add the plugin to the [dependencies]
in Cargo.toml
bevy_transform_gizmo = "0.2"
You will need to add the transform gizmo plugin, as well as make sure you have also brought in the picking plugin.
.add_plugins(bevy_mod_picking::DefaultPickingPlugins)
.add_plugin(bevy_transform_gizmo::TransformGizmoPlugin::default())
Next, you will need to mark your picking camera as your gizmo camera:
.insert_bundle(bevy_mod_picking::PickingCameraBundle::default())
.insert(bevy_transform_gizmo::GizmoPickSource::default());
Finally, mark any meshes you want to be transformed with the gizmo; note they must also be selectable in the picking plugin:
.insert_bundle(bevy_mod_picking::PickableBundle::default())
.insert(bevy_transform_gizmo::GizmoTransformable);
See the minimal demo for an example of a minimal implementation.
bevy_transform_gizmo is free and open source! 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. 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.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
The creation and maintenance of Bevy Transform Gizmo is sponsored by Foresight Mining Software Corporation.