Support new steamvr input for playspace rotate and move

This commit is contained in:
Kung-vr
2019-01-28 02:45:29 +09:00
parent de4cc5e88f
commit 775aaa7cd0
8 changed files with 769 additions and 164 deletions
+66 -2
View File
@@ -7,7 +7,7 @@
namespace input
{
/*!
Wrapper around the IVRInput GetAnalogActionData with error handling.
Wrapper around the IVRInput GetDigitalActionData with error handling.
The struct is created and zero initalized in this function instead of being
passed as reference since the size is currently only 28 bytes, and currently
@@ -129,7 +129,28 @@ SteamIVRInput::SteamIVRInput()
ActionType::Digital ),
m_pausePlayTrack( input_strings::k_actionPausePlayTrack,
ActionType::Digital ),
m_stopTrack( input_strings::k_actionStopTrack, ActionType::Digital )
m_stopTrack( input_strings::k_actionStopTrack, ActionType::Digital ),
m_leftHandPlayspaceRotate( input_strings::k_actionLeftHandPlayspaceRotate,
ActionType::Digital ),
m_rightHandPlayspaceRotate(
input_strings::k_actionRightHandPlayspaceRotate,
ActionType::Digital ),
m_leftHandPlayspaceMove( input_strings::k_actionLeftHandPlayspaceMove,
ActionType::Digital ),
m_rightHandPlayspaceMove( input_strings::k_actionRightHandPlayspaceMove,
ActionType::Digital ),
m_optionalOverrideLeftHandPlayspaceRotate(
input_strings::k_actionOptionalOverrideLeftHandPlayspaceRotate,
ActionType::Digital ),
m_optionalOverrideRightHandPlayspaceRotate(
input_strings::k_actionOptionalOverrideRightHandPlayspaceRotate,
ActionType::Digital ),
m_optionalOverrideLeftHandPlayspaceMove(
input_strings::k_actionOptionalOverrideLeftHandPlayspaceMove,
ActionType::Digital ),
m_optionalOverrideRightHandPlayspaceMove(
input_strings::k_actionOptionalOverrideRightHandPlayspaceMove,
ActionType::Digital )
{
m_activeActionSet.ulActionSet = m_mainSet.handle();
m_activeActionSet.ulRestrictedToDevice = vr::k_ulInvalidInputValueHandle;
@@ -179,6 +200,49 @@ bool SteamIVRInput::stopSong()
return isDigitalActionActivatedOnce( m_stopTrack );
}
bool SteamIVRInput::leftHandPlayspaceRotate()
{
return isDigitalActionActivatedConstant( m_leftHandPlayspaceRotate );
}
bool SteamIVRInput::rightHandPlayspaceRotate()
{
return isDigitalActionActivatedConstant( m_rightHandPlayspaceRotate );
}
bool SteamIVRInput::leftHandPlayspaceMove()
{
return isDigitalActionActivatedConstant( m_leftHandPlayspaceMove );
}
bool SteamIVRInput::rightHandPlayspaceMove()
{
return isDigitalActionActivatedConstant( m_rightHandPlayspaceMove );
}
bool SteamIVRInput::optionalOverrideLeftHandPlayspaceRotate()
{
return isDigitalActionActivatedConstant(
m_optionalOverrideLeftHandPlayspaceRotate );
}
bool SteamIVRInput::optionalOverrideRightHandPlayspaceRotate()
{
return isDigitalActionActivatedConstant(
m_optionalOverrideRightHandPlayspaceRotate );
}
bool SteamIVRInput::optionalOverrideLeftHandPlayspaceMove()
{
return isDigitalActionActivatedConstant(
m_optionalOverrideLeftHandPlayspaceMove );
}
bool SteamIVRInput::optionalOverrideRightHandPlayspaceMove()
{
return isDigitalActionActivatedConstant(
m_optionalOverrideRightHandPlayspaceMove );
}
/*!
Updates the active action set(s).
Should be called every frame, or however often you want the input system to