gilescope / bevy_spacemouse

Bevy spacemouse integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bevy_spacemouse

Bevy spacemouse integration (currently only works for linux - PRs welcome.)

Bevy game engine showing how to control things using a 3d space mouse.

In this example .insert(SpaceMouseControllable); has been added to the cube entity so that you control the cube:

cargo run --example cube

alternatively here the relative component is attached to the camera (.insert(SpaceMouseRelativeControllable);) so that you control the view:

cargo run --example cube-camera-controlled

dependencies:

This (alas) depends on c; if you're on mac then you can install

brew install libspnav

and also that your running the spacenavd daemon. (This is the open source driver for it.) I think this driver only works on linux sorry!

[dependencies]
bevy_spacemouse = { git="https://github.com/gilescope/bevy_spacemouse.git" }

imports:

use bevy_spacemouse::{SpaceMouseControllable, SpaceMousePlugin};

plugin:

The SpaceMouse will trigger events when the mouse is moved.

    .add_plugin(SpaceMousePlugin)

Configuration:

There's a resource called Scale that you can override the values there so that they make sense in the scale of the world that you are living in. Feel free to set both values to the same number.

License

Apache 2 / MIT license like rustc is.

About

Bevy spacemouse integration


Languages

Language:Rust 89.3%Language:Nix 10.7%