Skip to content

CustomRewired

Éloi Strée edited this page Apr 8, 2019 · 6 revisions

Why use Rewired

Buy/Download Rewired Hololens Custom Controller

Endure over time

The tools you are using change every 2-6 months. A way to avoid breaking your project is to linked it to a facade. Rewired is a very good one.

Example, MRTK Version: 2018 - V2 Beta
"PLEASE NOTE: This release is a significant breaking change from Mixed Reality Toolkit 2018.9.0 (released 2018/10/31) and all HoloToolkit releases."

Simulation

Cross platform

Allows the application to work on several platform

Compilation

It takes 2 x 10 minutes to compile application for Hololens! Build a simulator allows you to try your code in 20s instead of 20 minutes (Except when you try it to be sure everything is allright).

Price

A price of 40€ is expensive for new users on Unity,
but pays 40€ to avoid losing days of work at 500€ per day.

Example

With User Interface

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Rewired_HandsAsJoystick_UI : Rewired_HandsAsJoystick
{

    public Slider m_leftHandX;
    public Slider m_leftHandY;
    public Slider m_leftHandZ;

    public Slider m_rightHandX;
    public Slider m_rightHandY;
    public Slider m_rightHandZ;



    public Toggle m_triggerLeft;
    public Toggle m_grabbingLeft;

    public Toggle m_triggerRight;
    public Toggle m_grabbingRight;

    protected override float GetAxisInfo(int axisId)
    {
        switch (axisId)
        {
            case 0: return m_leftHandX.value;
            case 1: return m_leftHandY.value;
            case 2: return m_leftHandZ.value;
            case 3: return m_rightHandX.value;
            case 4: return m_rightHandY.value;
            case 5: return m_rightHandZ.value;
            default:
                return 0f;
        }
    }

    protected override bool GetButtonInfo(int buttonId)
    {
        switch (buttonId)
        {
            case 0: return m_triggerLeft.isOn;
            case 1: return m_grabbingLeft.isOn;
            case 2: return m_triggerRight.isOn;
            case 3: return m_grabbingRight.isOn;
            default:
                return false;
        }
    }
}

For Oculus Go

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Rewired_HandsAsJoystick_OculusGo : Rewired_HandsAsJoystick
{
    //https://developer.oculus.com/documentation/unity/latest/concepts/unity-ovrinput/
    protected override float GetAxisInfo(int axisId)
    {
       Vector2 touchAxis = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
        switch (axisId)
        {
            case 0: return -Mathf.Abs(touchAxis.x);
            case 1: return touchAxis.y;
            case 2: return 0f;
            case 3: return -Mathf.Abs(touchAxis.x);
            case 4: return touchAxis.y;
            case 5: return 0f;
            default:
                return 0f;
        }
    }

    protected override bool GetButtonInfo(int buttonId)
    {
        switch (buttonId)
        {
            case 0: return OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger);
            case 1: return OVRInput.Get(OVRInput.Button.PrimaryTouchpad);
            case 2: return OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger);
            case 3: return OVRInput.Get(OVRInput.Button.PrimaryTouchpad);
            default:
                return false;
        }
    }
}

⚠ Version 1.0 ⚠
Main Objective:

  • Learn the first step of using Hololens
  • Give the will to create game with MR after the workshop

My Objective:

  • Guess what will look like the 4-8 years technologies.
  • Learn the limitations of Hololens for my future clients
  • Have fun with Hololens

Index


Let's code

To download

Where to go now ?


Projects

Hololens 2

Buy


Playlist


What next ?

External Annex


Work in progress

⚠ Incomplete ⚠


Draft notes

Note I am taking during the construction of this workshop

Clone this wiki locally