Chaperone Tab Update (#101)

* added actions for haptics

* Haptic WIP #1 crash on haptic event

* haptics rough implemented

* fixed action names and prox sensor work-around

* added workaround to catch-all in begineer chaperone switch

* added idle work-around to alarm warning

* changed visibility slider values to reflect new API limits

* added disable chaperone

* added display Logic

* fixed visibility slider display and some saving fade distance when chaperone disabled

* fixed warnings not always working (hopefully) centralized action/input keys into ivrinput.h

* default bindings for HMD's

* chaperone input re-factor

* refactored ivrinput class

* fixed naming errors commented out prox testing

* formatting removed commented code

* format

* fixed compiler warnings

* updated documentation

* Reduced reload chaperone calls

* adjusted haptics for chaperone bounds warnings
This commit is contained in:
ykeara
2019-03-15 15:19:23 -05:00
committed by GitHub
parent 55b6d5de66
commit 3c5cab72e5
14 changed files with 425 additions and 77 deletions
+45
View File
@@ -0,0 +1,45 @@
#pragma once
#include <openvr.h>
#include <easylogging++.h>
namespace input
{
/*!
Represents an input source i.e. right controller
*/
class InputSource
{
public:
InputSource( const char* const inputSourceName ) : m_name( inputSourceName )
{
auto error
= vr::VRInput()->GetInputSourceHandle( inputSourceName, &m_handle );
if ( error != vr::EVRInputError::VRInputError_None )
{
LOG( ERROR ) << "Error getting input handle for '"
<< inputSourceName
<< "'. OpenVR Input Error: " << error;
}
}
/*!
An API internal handle that identifies an input handle.
*/
vr::VRInputValueHandle_t handle() const noexcept
{
return m_handle;
}
/*!
The actions manfiest name of the action. Used for error reporting.
*/
std::string name() const noexcept
{
return m_name;
}
private:
vr::VRInputValueHandle_t m_handle = 0;
const std::string m_name;
};
} // namespace input