https://github.com/oscrim/bevy_shape_draw
A simple bevy plugin for drawing a box using raycasting in 3d space
https://github.com/oscrim/bevy_shape_draw
bevy rust
Last synced: 3 months ago
JSON representation
A simple bevy plugin for drawing a box using raycasting in 3d space
- Host: GitHub
- URL: https://github.com/oscrim/bevy_shape_draw
- Owner: oscrim
- License: mit
- Created: 2022-12-06T08:28:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T12:20:58.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T12:03:07.170Z (4 months ago)
- Topics: bevy, rust
- Language: Rust
- Homepage:
- Size: 3.17 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bevy_shape_draw
[](https://crates.io/crates/bevy_shape_draw)
[](https://docs.rs/bevy_shape_draw)
[](https://github.com/bevyengine/bevy/blob/main/docs/plugins_guidelines.md#main-branch-tracking)A [Bevy](https://github.com/bevyengine/bevy) plugin for drawing a shape using raycasting in 3d space with a mouse. This plugin is build on and relies on [`bevy_mod_raycast`](https://github.com/aevyrie/bevy_mod_picking).
The only shape that can be drawn at the moment is a box of fixed height
Add the plugin to the `[dependencies]` in `Cargo.toml`
```toml
bevy_shape_draw = "0.1"
```You will need to add the Draw Shape Plugin.
```rust
.add_plugin(bevy_shape_draw::DrawShapePlugin)
```Then you will have to add the raycast source to your camera.
```rust
.insert(bevy_shape_draw::ShapeDrawRaycastSource::new())
```Finally, mark any meshes that you want to be able to draw shapes on.
```rust
.insert(bevy_shape_draw::ShapeDrawRaycastMesh::default())
```## Example
```shell
cargo run --example simple
``````shell
cargo run --example events
```