Code Monkey home page Code Monkey logo

godot-wiimote's Introduction

godot-wiimote

A Wii Remote interface for Godot4 using GDExtension.

This is based on the godot-cpp template, a quickstart template for GDExtension development with Godot 4.0+.

This project targets the latest verison of godot (4.1).

This repository was primarily created to perform wii remote head tracking using IR data from a static wii remote. While supporting additional functions of the wiimote are preferred, I am not familiar enough with godot to know what the best way to do this is - contributions are absolutely welcome!

Contents

  • An Godot project for demonstrating the functionality (demo/)
  • godot-cpp as a submodule (godot-cpp/) to integrate with the WiiUse C++ library
  • GitHub CI/CD confirm build functionality and upload library packages when creating a release (.github/workflows/builds.yml)
  • source code for C++ GDExtension (src/)

Dependencies

In order to build, you must ensure dependencies are installed/available on your system.

Wiiuse

Ensure the WiiUse library is installed in a location that can be found by your system

Wiiuse may also depend on additional things based on your platform, see the wiiuse README for more detailed, platform-specific instructions.

Building wiiuse (unix)

git clone https://github.com/wiiuse/wiiuse.git
cd wiiuse
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLE_SDL=NO -DBUILD_SHARED_LIBS=TRUE
make wiiuse
sudo make install

Building wiiuse (macos)

see unix instructions, except use the following cmake command if you want support for universal binaries (for both intel and Apple Silicon macs): cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLE_SDL=NO -DBUILD_SHARED_LIBS=TRUE "-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64"

Building

The build process should be realtively straghtforward since this project adheres to the typical GDExtension convention of using scons as a build system. For most platforms, the build process should just involve running the scons command.

Setting up the extension in a fresh project

To add the extension to a godot 4.1+ project, open the project and import the .zip file [TBD, see #6] or the .gdextension file using the import button on the AssetLib tab of Godot.

Usage

A minimal example of how to use the extension can be found in the demo directory

When you start the demo by pressing the play button you will see the godot engine logo for longer than you may be used to (about 5 seconds) - as soon as you see this, hit the 1+2 buttons on your wii remote to make it discoverable. If it successfully discovers and connects to your remote, youll get a little vibration/buzz (like a real wii does) and the player 1 light on the wiimote will turn on.

If you successfully connect to a wiimote, then it should be looking for IR sensor data (such as from the sensor bar, or really any two IR sources spaced about that far apart - two candles may work in a pinch) to change the position of the camera (like Johnny Lee's wiimote head tracking demo)

Developer Documentation

For internal/development documentation see docs/index.md

godot-wiimote's People

Contributors

adamscott avatar akien-mga avatar athousandships avatar moralcode avatar paddy-exe avatar vxl9440 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

godot-wiimote's Issues

Have the wiimote appear to Godot like a controller

Godot already has an InputEvent system and controller mapping - i just have no idea whether a GDExtension is able to hook into that or whether the abstractions for controllers support all the different kinds of things a wiimote can do.

need more godot expertise for this one

also its kinda important to get this architecture right from the start before a ton of work is done on more complete wiimote support

Support for wiimote buttons

this is probably already covered by the godot input system/controller mapping, but the question is: is this mechanism extendable to the other functions of a wiimote (IR/accelerometer .etc). see #2

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.