Git Product home page Git Product logo

bevy_spacemouse's Introduction

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.

bevy_spacemouse's People

Contributors

gilescope avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

bevy_spacemouse's Issues

only works on linux

Mate said rusb might help - that could detect the usb on a mac. The mac seemed to see it as a mouse so maybe we can start there and then expand to the rotation data... must be some example of listening to a mouse somewhere.

laggy sometimes

It can be a tad laggy. I think the mechanism for getting the events might need to be reworked rather than the polling it should be a thread that awaits.

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.