VR Interaction Framework v2.0
Loading...
Searching...
No Matches
BNG.InputBridge Class Reference

A proxy for handling input from various input providers such as OVRInput, XRInput, and SteamVR. More...

Inheritance diagram for BNG.InputBridge:

Public Member Functions

delegate void InputsUpdatedAction ()
 Called after update loop.
 
delegate void ControllerFoundAction ()
 Called once a controller has been successfully detected.
 
virtual void UpdateInputs ()
 
virtual void UpdateSteamInput ()
 
virtual void UpdateXRInput ()
 
virtual void UpdateUnityInput ()
 
virtual void CreateUnityInputActions ()
 
virtual void EnableActions ()
 
virtual void DisableActions ()
 
UnityEngine.InputSystem.InputAction CreateInputAction (string actionName, string binding, bool valueType)
 
virtual void UpdateOVRInput ()
 
virtual void UpdatePicoInput ()
 
virtual void UpdateDeviceActive ()
 
bool GetControllerBindingValue (ControllerBinding val)
 Returns true if the given binding is pressed.
 
bool GetGrabbedControllerBinding (GrabbedControllerBinding val, ControllerHand hand)
 
Vector2 GetInputAxisValue (InputAxis val)
 
virtual bool GetSupportsXRInput ()
 
virtual bool GetSupportsIndexTouch ()
 Returns true if the controllers support the 'indexTouch' XR input mapping.Currently only Oculus devices on the Oculus SDK support index touch. OpenVR is not supported.
 
virtual SDKProvider GetLoadedSDK ()
 
virtual bool GetSupportsThumbTouch ()
 
virtual bool GetIsOculusDevice ()
 
virtual bool GetIsOculusQuest ()
 
virtual bool GetIsHTCDevice ()
 
virtual bool GetIsPicoDevice ()
 
InputDevice GetHMD ()
 
string GetHMDName ()
 Returns the name of the InputDevice if found. Returns String.empty if not found.
 
Vector3 GetHMDLocalPosition ()
 
Quaternion GetHMDLocalRotation ()
 
InputDevice GetLeftController ()
 
InputDevice GetRightController ()
 
Vector3 GetControllerLocalPosition (ControllerHand handSide)
 
Quaternion GetControllerLocalRotation (ControllerHand handSide)
 
virtual ControllerType GetControllerType ()
 
Vector3 GetControllerVelocity (ControllerHand hand)
 
Vector3 GetControllerAngularVelocity (ControllerHand hand)
 
virtual string GetControllerName ()
 Get the name of the primary controller.
 
virtual bool GetIsValveIndexController ()
 
virtual void SetTrackingOriginMode (TrackingOriginModeFlags trackingOrigin)
 
void VibrateController (float frequency, float amplitude, float duration, ControllerHand hand)
 

Public Attributes

XRInputSource InputSource = XRInputSource.XRInput
 
UnityEngine.InputSystem.InputActionAsset actionSet
 
TrackingOriginModeFlags TrackingOrigin = TrackingOriginModeFlags.Floor
 
float ThumbstickDeadzoneX = 0.001f
 Thumbstick X must be greater than this amount to be considered valid.
 
float ThumbstickDeadzoneY = 0.001f
 Thumbstick Y must be greater than this amount to be considered valid.
 
float LeftGrip = 0
 How far Left Grip is Held down. Values : 0 - 1 (Fully Open / Closed)
 
bool LeftGripDown = false
 Left Grip was pressed down this frame, but not last.
 
float RightGrip = 0
 How far Right Grip is Held down. Values : 0 - 1 (Fully Open / Closed)
 
bool RightGripDown = false
 Right Grip was pressed down this frame, but not last.
 
float LeftTrigger = 0
 How far Left Trigger is Held down. Values : 0 - 1 (Fully Open / Closed)
 
bool LeftTriggerNear = false
 
bool LeftTriggerUp = false
 
bool LeftTriggerDown = false
 Returns true if Left Trigger was held down this frame but not the last.
 
float RightTrigger = 0
 How far Left Trigger is Held down. Values : 0 - 1 (Fully Open / Closed)
 
bool RightTriggerUp = false
 Returns true if Right Trigger is all the way up this frame but not last.
 
bool RightTriggerDown = false
 Returns true if Right Trigger was held down this frame but not the last.
 
bool RightTriggerNear = false
 
bool LeftThumbNear = false
 
bool RightThumbNear = false
 
bool LeftThumbstickDown = false
 Pressed down this frame, but not last.
 
bool LeftThumbstickUp = false
 Released this frame but not last.
 
bool RightThumbstickDown = false
 Pressed down this frame, but not last.
 
bool RightThumbstickUp = false
 Released this frame but not last.
 
bool LeftThumbstick = false
 Currently Held Down.
 
bool RightThumbstick = false
 
bool AButton = false
 Is the A button currently being held down.
 
bool AButtonDown = false
 Returns true if the A Button was pressed down this frame but not last.
 
bool AButtonUp = false
 
bool BButton = false
 Is the B button currently being held down.
 
bool BButtonDown = false
 Returns true if the B Button was pressed down this frame but not last.
 
bool BButtonUp = false
 
bool XButton = false
 
bool XButtonDown = false
 Returns true if the X Button was pressed down this frame but not last.
 
bool XButtonUp = false
 
bool YButton = false
 
bool YButtonDown = false
 Returns true if the Y Button was pressed down this frame but not last.
 
bool YButtonUp = false
 
bool StartButton = false
 
bool StartButtonDown = false
 
bool BackButton = false
 
bool BackButtonDown = false
 
Vector2 LeftThumbstickAxis
 
Vector2 RightThumbstickAxis
 
Vector2 LeftTouchPadAxis
 
Vector2 RightTouchPadAxis
 
float LeftThumbCurl = 0f
 
float LeftIndexCurl = 0f
 
float LeftMiddleCurl = 0f
 
float LeftRingCurl = 0f
 
float LeftPinkyCurl = 0f
 
float RightThumbCurl = 0f
 
float RightIndexCurl = 0f
 
float RightMiddleCurl = 0f
 
float RightRingCurl = 0f
 
float RightPinkyCurl = 0f
 
ControllerType ConnectedControllerType
 
bool HMDActive = false
 
bool SupportsBothTouchPadAndJoystick
 Returns true if the controller has both a Touchpad and a Joystick. Currently only the Valve Index has both.
 
bool SupportsIndexTouch
 Returns true if the controllers support the 'indexTouch' (or 'near trigger') XR input mapping. Currently only Oculus devices on the Oculus SDK support index touch. OpenVR is not supported.
 
bool SupportsThumbTouch
 Returns true if the controllers support the 'ThumbTouch' (or near thumbstick) XR input mapping. Currently only Oculus devices on the Oculus SDK support index touch. OpenVR is not supported.
 
bool ShowInputDebugger = false
 

Properties

static InputBridge Instance [get]
 Instance of our Singleton.
 
float DownThreshold [get]
 What threshold constitutes a "down" event. For example, pushing the trigger down 20% (0.2) of the way considered starting a trigger down event This is used in XRInput.
 
SDKProvider LoadedSDK [get]
 
bool IsOculusDevice [get]
 
bool IsOculusQuest [get]
 
bool IsHTCDevice [get]
 
bool IsPicoDevice [get]
 
bool IsValveIndexController [get]
 

Events

static InputsUpdatedAction OnInputsUpdated
 
static ControllerFoundAction OnControllerFound
 

Detailed Description

A proxy for handling input from various input providers such as OVRInput, XRInput, and SteamVR.

Member Function Documentation

◆ ControllerFoundAction()

delegate void BNG.InputBridge.ControllerFoundAction ( )

Called once a controller has been successfully detected.

◆ CreateInputAction()

UnityEngine.InputSystem.InputAction BNG.InputBridge.CreateInputAction ( string  actionName,
string  binding,
bool  valueType 
)

◆ CreateUnityInputActions()

virtual void BNG.InputBridge.CreateUnityInputActions ( )
virtual

◆ DisableActions()

virtual void BNG.InputBridge.DisableActions ( )
virtual

◆ EnableActions()

virtual void BNG.InputBridge.EnableActions ( )
virtual

◆ GetControllerAngularVelocity()

Vector3 BNG.InputBridge.GetControllerAngularVelocity ( ControllerHand  hand)

◆ GetControllerBindingValue()

bool BNG.InputBridge.GetControllerBindingValue ( ControllerBinding  val)

Returns true if the given binding is pressed.

◆ GetControllerLocalPosition()

Vector3 BNG.InputBridge.GetControllerLocalPosition ( ControllerHand  handSide)

◆ GetControllerLocalRotation()

Quaternion BNG.InputBridge.GetControllerLocalRotation ( ControllerHand  handSide)

◆ GetControllerName()

virtual string BNG.InputBridge.GetControllerName ( )
virtual

Get the name of the primary controller.

Returns
The name of the primary controller. Returns empty if no controller found

◆ GetControllerType()

virtual ControllerType BNG.InputBridge.GetControllerType ( )
virtual

◆ GetControllerVelocity()

Vector3 BNG.InputBridge.GetControllerVelocity ( ControllerHand  hand)

◆ GetGrabbedControllerBinding()

bool BNG.InputBridge.GetGrabbedControllerBinding ( GrabbedControllerBinding  val,
ControllerHand  hand 
)

◆ GetHMD()

InputDevice BNG.InputBridge.GetHMD ( )

◆ GetHMDLocalPosition()

Vector3 BNG.InputBridge.GetHMDLocalPosition ( )

◆ GetHMDLocalRotation()

Quaternion BNG.InputBridge.GetHMDLocalRotation ( )

◆ GetHMDName()

string BNG.InputBridge.GetHMDName ( )

Returns the name of the InputDevice if found. Returns String.empty if not found.

Returns
The name of the InputDevice if found, or String.empty if not found

◆ GetInputAxisValue()

Vector2 BNG.InputBridge.GetInputAxisValue ( InputAxis  val)

◆ GetIsHTCDevice()

virtual bool BNG.InputBridge.GetIsHTCDevice ( )
virtual

◆ GetIsOculusDevice()

virtual bool BNG.InputBridge.GetIsOculusDevice ( )
virtual

◆ GetIsOculusQuest()

virtual bool BNG.InputBridge.GetIsOculusQuest ( )
virtual

◆ GetIsPicoDevice()

virtual bool BNG.InputBridge.GetIsPicoDevice ( )
virtual

◆ GetIsValveIndexController()

virtual bool BNG.InputBridge.GetIsValveIndexController ( )
virtual

◆ GetLeftController()

InputDevice BNG.InputBridge.GetLeftController ( )

◆ GetLoadedSDK()

virtual SDKProvider BNG.InputBridge.GetLoadedSDK ( )
virtual

◆ GetRightController()

InputDevice BNG.InputBridge.GetRightController ( )

◆ GetSupportsIndexTouch()

virtual bool BNG.InputBridge.GetSupportsIndexTouch ( )
virtual

Returns true if the controllers support the 'indexTouch' XR input mapping.Currently only Oculus devices on the Oculus SDK support index touch. OpenVR is not supported.

Returns

◆ GetSupportsThumbTouch()

virtual bool BNG.InputBridge.GetSupportsThumbTouch ( )
virtual

◆ GetSupportsXRInput()

virtual bool BNG.InputBridge.GetSupportsXRInput ( )
virtual

◆ InputsUpdatedAction()

delegate void BNG.InputBridge.InputsUpdatedAction ( )

Called after update loop.

◆ SetTrackingOriginMode()

virtual void BNG.InputBridge.SetTrackingOriginMode ( TrackingOriginModeFlags  trackingOrigin)
virtual

◆ UpdateDeviceActive()

virtual void BNG.InputBridge.UpdateDeviceActive ( )
virtual

◆ UpdateInputs()

virtual void BNG.InputBridge.UpdateInputs ( )
virtual

◆ UpdateOVRInput()

virtual void BNG.InputBridge.UpdateOVRInput ( )
virtual

◆ UpdatePicoInput()

virtual void BNG.InputBridge.UpdatePicoInput ( )
virtual

◆ UpdateSteamInput()

virtual void BNG.InputBridge.UpdateSteamInput ( )
virtual

◆ UpdateUnityInput()

virtual void BNG.InputBridge.UpdateUnityInput ( )
virtual

◆ UpdateXRInput()

virtual void BNG.InputBridge.UpdateXRInput ( )
virtual

◆ VibrateController()

void BNG.InputBridge.VibrateController ( float  frequency,
float  amplitude,
float  duration,
ControllerHand  hand 
)

Member Data Documentation

◆ AButton

bool BNG.InputBridge.AButton = false

Is the A button currently being held down.

◆ AButtonDown

bool BNG.InputBridge.AButtonDown = false

Returns true if the A Button was pressed down this frame but not last.

◆ AButtonUp

bool BNG.InputBridge.AButtonUp = false

◆ actionSet

UnityEngine.InputSystem.InputActionAsset BNG.InputBridge.actionSet

◆ BackButton

bool BNG.InputBridge.BackButton = false

◆ BackButtonDown

bool BNG.InputBridge.BackButtonDown = false

◆ BButton

bool BNG.InputBridge.BButton = false

Is the B button currently being held down.

◆ BButtonDown

bool BNG.InputBridge.BButtonDown = false

Returns true if the B Button was pressed down this frame but not last.

◆ BButtonUp

bool BNG.InputBridge.BButtonUp = false

◆ ConnectedControllerType

ControllerType BNG.InputBridge.ConnectedControllerType

◆ HMDActive

bool BNG.InputBridge.HMDActive = false

◆ InputSource

XRInputSource BNG.InputBridge.InputSource = XRInputSource.XRInput

◆ LeftGrip

float BNG.InputBridge.LeftGrip = 0

How far Left Grip is Held down. Values : 0 - 1 (Fully Open / Closed)

◆ LeftGripDown

bool BNG.InputBridge.LeftGripDown = false

Left Grip was pressed down this frame, but not last.

◆ LeftIndexCurl

float BNG.InputBridge.LeftIndexCurl = 0f

◆ LeftMiddleCurl

float BNG.InputBridge.LeftMiddleCurl = 0f

◆ LeftPinkyCurl

float BNG.InputBridge.LeftPinkyCurl = 0f

◆ LeftRingCurl

float BNG.InputBridge.LeftRingCurl = 0f

◆ LeftThumbCurl

float BNG.InputBridge.LeftThumbCurl = 0f

◆ LeftThumbNear

bool BNG.InputBridge.LeftThumbNear = false

◆ LeftThumbstick

bool BNG.InputBridge.LeftThumbstick = false

Currently Held Down.

◆ LeftThumbstickAxis

Vector2 BNG.InputBridge.LeftThumbstickAxis

◆ LeftThumbstickDown

bool BNG.InputBridge.LeftThumbstickDown = false

Pressed down this frame, but not last.

◆ LeftThumbstickUp

bool BNG.InputBridge.LeftThumbstickUp = false

Released this frame but not last.

◆ LeftTouchPadAxis

Vector2 BNG.InputBridge.LeftTouchPadAxis

◆ LeftTrigger

float BNG.InputBridge.LeftTrigger = 0

How far Left Trigger is Held down. Values : 0 - 1 (Fully Open / Closed)

◆ LeftTriggerDown

bool BNG.InputBridge.LeftTriggerDown = false

Returns true if Left Trigger was held down this frame but not the last.

◆ LeftTriggerNear

bool BNG.InputBridge.LeftTriggerNear = false

◆ LeftTriggerUp

bool BNG.InputBridge.LeftTriggerUp = false

◆ RightGrip

float BNG.InputBridge.RightGrip = 0

How far Right Grip is Held down. Values : 0 - 1 (Fully Open / Closed)

◆ RightGripDown

bool BNG.InputBridge.RightGripDown = false

Right Grip was pressed down this frame, but not last.

◆ RightIndexCurl

float BNG.InputBridge.RightIndexCurl = 0f

◆ RightMiddleCurl

float BNG.InputBridge.RightMiddleCurl = 0f

◆ RightPinkyCurl

float BNG.InputBridge.RightPinkyCurl = 0f

◆ RightRingCurl

float BNG.InputBridge.RightRingCurl = 0f

◆ RightThumbCurl

float BNG.InputBridge.RightThumbCurl = 0f

◆ RightThumbNear

bool BNG.InputBridge.RightThumbNear = false

◆ RightThumbstick

bool BNG.InputBridge.RightThumbstick = false

◆ RightThumbstickAxis

Vector2 BNG.InputBridge.RightThumbstickAxis

◆ RightThumbstickDown

bool BNG.InputBridge.RightThumbstickDown = false

Pressed down this frame, but not last.

◆ RightThumbstickUp

bool BNG.InputBridge.RightThumbstickUp = false

Released this frame but not last.

◆ RightTouchPadAxis

Vector2 BNG.InputBridge.RightTouchPadAxis

◆ RightTrigger

float BNG.InputBridge.RightTrigger = 0

How far Left Trigger is Held down. Values : 0 - 1 (Fully Open / Closed)

◆ RightTriggerDown

bool BNG.InputBridge.RightTriggerDown = false

Returns true if Right Trigger was held down this frame but not the last.

◆ RightTriggerNear

bool BNG.InputBridge.RightTriggerNear = false

◆ RightTriggerUp

bool BNG.InputBridge.RightTriggerUp = false

Returns true if Right Trigger is all the way up this frame but not last.

◆ ShowInputDebugger

bool BNG.InputBridge.ShowInputDebugger = false

◆ StartButton

bool BNG.InputBridge.StartButton = false

◆ StartButtonDown

bool BNG.InputBridge.StartButtonDown = false

◆ SupportsBothTouchPadAndJoystick

bool BNG.InputBridge.SupportsBothTouchPadAndJoystick

Returns true if the controller has both a Touchpad and a Joystick. Currently only the Valve Index has both.

◆ SupportsIndexTouch

bool BNG.InputBridge.SupportsIndexTouch

Returns true if the controllers support the 'indexTouch' (or 'near trigger') XR input mapping. Currently only Oculus devices on the Oculus SDK support index touch. OpenVR is not supported.

◆ SupportsThumbTouch

bool BNG.InputBridge.SupportsThumbTouch

Returns true if the controllers support the 'ThumbTouch' (or near thumbstick) XR input mapping. Currently only Oculus devices on the Oculus SDK support index touch. OpenVR is not supported.

◆ ThumbstickDeadzoneX

float BNG.InputBridge.ThumbstickDeadzoneX = 0.001f

Thumbstick X must be greater than this amount to be considered valid.

◆ ThumbstickDeadzoneY

float BNG.InputBridge.ThumbstickDeadzoneY = 0.001f

Thumbstick Y must be greater than this amount to be considered valid.

◆ TrackingOrigin

TrackingOriginModeFlags BNG.InputBridge.TrackingOrigin = TrackingOriginModeFlags.Floor

◆ XButton

bool BNG.InputBridge.XButton = false

◆ XButtonDown

bool BNG.InputBridge.XButtonDown = false

Returns true if the X Button was pressed down this frame but not last.

◆ XButtonUp

bool BNG.InputBridge.XButtonUp = false

◆ YButton

bool BNG.InputBridge.YButton = false

◆ YButtonDown

bool BNG.InputBridge.YButtonDown = false

Returns true if the Y Button was pressed down this frame but not last.

◆ YButtonUp

bool BNG.InputBridge.YButtonUp = false

Property Documentation

◆ DownThreshold

float BNG.InputBridge.DownThreshold
get

What threshold constitutes a "down" event. For example, pushing the trigger down 20% (0.2) of the way considered starting a trigger down event This is used in XRInput.

◆ Instance

InputBridge BNG.InputBridge.Instance
staticget

Instance of our Singleton.

◆ IsHTCDevice

bool BNG.InputBridge.IsHTCDevice
get

◆ IsOculusDevice

bool BNG.InputBridge.IsOculusDevice
get

◆ IsOculusQuest

bool BNG.InputBridge.IsOculusQuest
get

◆ IsPicoDevice

bool BNG.InputBridge.IsPicoDevice
get

◆ IsValveIndexController

bool BNG.InputBridge.IsValveIndexController
get

◆ LoadedSDK

SDKProvider BNG.InputBridge.LoadedSDK
get

Event Documentation

◆ OnControllerFound

ControllerFoundAction BNG.InputBridge.OnControllerFound
static

◆ OnInputsUpdated

InputsUpdatedAction BNG.InputBridge.OnInputsUpdated
static

The documentation for this class was generated from the following file: