Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Controller Swipe Direction

Discussion in 'Xiaomi' started by moldywarpe, Dec 2, 2018.

  1. moldywarpe

    moldywarpe

    Joined:
    Jan 18, 2017
    Posts:
    20
    Ok, on to the next issue....
    Does anybody know how to determine the swipe direction of the controller?

    Oculus provides values to interrogate
    e.g
    Swipe down = OVRInput.GetUp(OVRInput.RawButton.DpadDown)
    Swipe left = OVRInput.GetUp(OVRInput.RawButton.DpadLeft)

    Pico also provides values to interrogate
    e.g.
    SwipeDirection swipeDirection = Controller.UPvr_GetSwipeDirection(0);
    Swipe down = SwipeDirection.SwipeDown
    Swipe left = SwipeDirection.SwipeLeft

    But MiVR appears to simply provide a touch position on the ClickButton which means you have to determine when it is first touched (InputManager.ControllerState.TouchDown), and get the InputManager.ControllerState.TouchPosition then when the touch is released (InputManager.ControllerState.TouchUp) get the InputManager.ControllerState.TouchPosition and then try and calculate the drirection between the two points...!

    Surely I've missed something here and there is an easier way to do this?
    Using Mi VR SDK for Unity 1.8.7

    Cheers