GithubHelp home page GithubHelp logo

elpiel / bevy_transform_gizmo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from foresightminingsoftwarecorporation/bevy_transform_gizmo

0.0 0.0 0.0 42.11 MB

A 3d gizmo for transforming entities in Bevy.

License: Other

Rust 100.00%

bevy_transform_gizmo's Introduction

Bevy Transform Gizmo

This Bevy plugin adds a transform gizmo to entities in the scene, allowing you to drag and rotate meshes with your mouse.

Demo.mp4

Demo

Run a minimal implementation of the gizmo by cloning this repository and running:

cargo run --example minimal

Features

  • Prebuilt transform gizmo appears when you select a designated mesh
  • Translation handles
  • Rotation handles
  • Gizmo always renders on top of the main render pass
  • Gizmo scales at it moves closer/further from the camera

Usage

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 = { git = "https://github.com/ForesightMiningSoftwareCorporation/bevy_transform_gizmo", branch = "main" }

You will need to add the transform gizmo plugin, as well as make sure you have also brought in the picking plugin.

.add_plugin(bevy_mod_picking::DefaultPickingPlugins)
.add_plugin(bevy_transform_gizmo::TransformGizmoPlugin)

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.

License

bevy_transform_gizmo is free and open source! 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.

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.

Sponsors

The creation and maintenance of Bevy Transform Gizmo is sponsored by Foresight Mining Software Corporation.

Foresight Mining Software Corporation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.