bevy_nokhwa

link to crates.io link to docs.rs link to license downloads/link to crates.io stars/github repo github actions tracking bevy release branch



A bevy plugin using nokhawa.

This plugin allows you to render Camera Capture at background.

Showcase

```rust use bevy::prelude::*; use bevy_nokhwa::BevyNokhwaPlugin;

fn main() { App::new() .addplugins(DefaultPlugins) .addplugin(BevyNokhwaPlugin) .addstartupsystem(setup_camera) .run(); }

fn setupcamera( mut commands: Commands, mut meshes: ResMut>, mut materials: ResMut>, ) { commands .spawn(Camera3dBundle { camera3d: Camera3d { // IMPORTANT! Need to set clearcolor to None clearcolor: ClearColorConfig::None, ..default() }, transform: Transform::fromxyz(-2.0, 2.5, 5.0).lookingat(Vec3::ZERO, Vec3::Y), ..Default::default() }) // auto find camera and use highest resolution // .insert(BackgroundCamera::auto()) .insert(BackgroundCamera::new( ApiBackend::Auto, Some(CameraIndex::Index(0)), Some(RequestedFormatType::Closest(CameraFormat::new( Resolution::new(640, 480), FrameFormat::MJPEG, 30, ))), )); } ```

Support

Bevy tracking

|bevy| bevy_nokhwa | |--|-------------| |0.10| 0.2.X | |0.9| 0.1.X |

Licensing

The project is under dual license MIT and Apache 2.0, so joink to your hearts content, just remember the license agreements.

Contributing

Yes this project is still very much WIP, so PRs are very welcome