3 releases

0.1.2 Jan 4, 2023
0.1.1 Dec 6, 2022
0.1.0 Dec 6, 2022

#1109 in Game dev

Download history 4/week @ 2024-02-19 4/week @ 2024-02-26 60/week @ 2024-04-01

60 downloads per month

MIT license

3.5MB
495 lines

bevy_shape_draw

crates.io docs.rs Bevy tracking

A 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.

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

bevy_shape_draw = "0.1"

You will need to add the Draw Shape Plugin.

.add_plugin(bevy_shape_draw::DrawShapePlugin)

Then you will have to add the raycast source to your camera.

.insert(bevy_shape_draw::ShapeDrawRaycastSource::new())

Finally, mark any meshes that you want to be able to draw shapes on.

.insert(bevy_shape_draw::ShapeDrawRaycastMesh::default())

Example

cargo run --example simple
cargo run --example events

Dependencies

~32–47MB
~619K SLoC