Add bindable axis lock actions
This commit is contained in:
@@ -166,6 +166,12 @@ SteamIVRInput::SteamIVRInput()
|
|||||||
ActionType::Digital ),
|
ActionType::Digital ),
|
||||||
m_snapTurnRight( input_strings::k_actionSnapTurnRight,
|
m_snapTurnRight( input_strings::k_actionSnapTurnRight,
|
||||||
ActionType::Digital ),
|
ActionType::Digital ),
|
||||||
|
m_xAxisLockToggle( input_strings::k_actionXAxisLockToggle,
|
||||||
|
ActionType::Digital ),
|
||||||
|
m_yAxisLockToggle( input_strings::k_actionYAxisLockToggle,
|
||||||
|
ActionType::Digital ),
|
||||||
|
m_zAxisLockToggle( input_strings::k_actionZAxisLockToggle,
|
||||||
|
ActionType::Digital ),
|
||||||
m_pushToTalk( input_strings::k_actionPushToTalk, ActionType::Digital )
|
m_pushToTalk( input_strings::k_actionPushToTalk, ActionType::Digital )
|
||||||
{
|
{
|
||||||
m_activeActionSet.ulActionSet = m_mainSet.handle();
|
m_activeActionSet.ulActionSet = m_mainSet.handle();
|
||||||
@@ -296,6 +302,21 @@ bool SteamIVRInput::snapTurnRight()
|
|||||||
return isDigitalActionActivatedOnce( m_snapTurnRight );
|
return isDigitalActionActivatedOnce( m_snapTurnRight );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::xAxisLockToggle()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedOnce( m_xAxisLockToggle );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::yAxisLockToggle()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedOnce( m_yAxisLockToggle );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::zAxisLockToggle()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedOnce( m_zAxisLockToggle );
|
||||||
|
}
|
||||||
|
|
||||||
bool SteamIVRInput::pushToTalk()
|
bool SteamIVRInput::pushToTalk()
|
||||||
{
|
{
|
||||||
return isDigitalActionActivatedConstant( m_pushToTalk );
|
return isDigitalActionActivatedConstant( m_pushToTalk );
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ public:
|
|||||||
bool resetOffsets();
|
bool resetOffsets();
|
||||||
bool snapTurnLeft();
|
bool snapTurnLeft();
|
||||||
bool snapTurnRight();
|
bool snapTurnRight();
|
||||||
|
bool xAxisLockToggle();
|
||||||
|
bool yAxisLockToggle();
|
||||||
|
bool zAxisLockToggle();
|
||||||
|
|
||||||
bool pushToTalk();
|
bool pushToTalk();
|
||||||
|
|
||||||
@@ -104,6 +107,9 @@ private:
|
|||||||
Action m_resetOffsets;
|
Action m_resetOffsets;
|
||||||
Action m_snapTurnLeft;
|
Action m_snapTurnLeft;
|
||||||
Action m_snapTurnRight;
|
Action m_snapTurnRight;
|
||||||
|
Action m_xAxisLockToggle;
|
||||||
|
Action m_yAxisLockToggle;
|
||||||
|
Action m_zAxisLockToggle;
|
||||||
|
|
||||||
// Push To Talk
|
// Push To Talk
|
||||||
Action m_pushToTalk;
|
Action m_pushToTalk;
|
||||||
@@ -146,6 +152,9 @@ namespace input_strings
|
|||||||
constexpr auto k_actionResetOffsets = "/actions/main/in/ResetOffsets";
|
constexpr auto k_actionResetOffsets = "/actions/main/in/ResetOffsets";
|
||||||
constexpr auto k_actionSnapTurnLeft = "/actions/main/in/SnapTurnLeft";
|
constexpr auto k_actionSnapTurnLeft = "/actions/main/in/SnapTurnLeft";
|
||||||
constexpr auto k_actionSnapTurnRight = "/actions/main/in/SnapTurnRight";
|
constexpr auto k_actionSnapTurnRight = "/actions/main/in/SnapTurnRight";
|
||||||
|
constexpr auto k_actionXAxisLockToggle = "/actions/main/in/XAxisLockToggle";
|
||||||
|
constexpr auto k_actionYAxisLockToggle = "/actions/main/in/YAxisLockToggle";
|
||||||
|
constexpr auto k_actionZAxisLockToggle = "/actions/main/in/ZAxisLockToggle";
|
||||||
|
|
||||||
constexpr auto k_actionPushToTalk = "/actions/main/in/PushToTalk";
|
constexpr auto k_actionPushToTalk = "/actions/main/in/PushToTalk";
|
||||||
|
|
||||||
|
|||||||
@@ -510,6 +510,9 @@ void OverlayController::processRoomBindings()
|
|||||||
m_moveCenterTabController.resetOffsets( m_actions.resetOffsets() );
|
m_moveCenterTabController.resetOffsets( m_actions.resetOffsets() );
|
||||||
m_moveCenterTabController.snapTurnLeft( m_actions.snapTurnLeft() );
|
m_moveCenterTabController.snapTurnLeft( m_actions.snapTurnLeft() );
|
||||||
m_moveCenterTabController.snapTurnRight( m_actions.snapTurnRight() );
|
m_moveCenterTabController.snapTurnRight( m_actions.snapTurnRight() );
|
||||||
|
m_moveCenterTabController.xAxisLockToggle( m_actions.xAxisLockToggle() );
|
||||||
|
m_moveCenterTabController.yAxisLockToggle( m_actions.yAxisLockToggle() );
|
||||||
|
m_moveCenterTabController.zAxisLockToggle( m_actions.zAxisLockToggle() );
|
||||||
|
|
||||||
// override actions:
|
// override actions:
|
||||||
m_moveCenterTabController.optionalOverrideLeftHandSpaceDrag(
|
m_moveCenterTabController.optionalOverrideLeftHandSpaceDrag(
|
||||||
|
|||||||
@@ -101,6 +101,21 @@
|
|||||||
"requirement": "optional",
|
"requirement": "optional",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/XAxisLockToggle",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/YAxisLockToggle",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/ZAxisLockToggle",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "/actions/main/in/PushToTalk",
|
"name": "/actions/main/in/PushToTalk",
|
||||||
"requirement": "optional",
|
"requirement": "optional",
|
||||||
@@ -138,6 +153,9 @@
|
|||||||
"/actions/main/in/ResetOffsets" : "Reset Offsets",
|
"/actions/main/in/ResetOffsets" : "Reset Offsets",
|
||||||
"/actions/main/in/SnapTurnLeft" : "Snap-Turn Left",
|
"/actions/main/in/SnapTurnLeft" : "Snap-Turn Left",
|
||||||
"/actions/main/in/SnapTurnRight" : "Snap-Turn Right",
|
"/actions/main/in/SnapTurnRight" : "Snap-Turn Right",
|
||||||
|
"/actions/main/in/XAxisLockToggle" : "X-Axis Lock Toggle",
|
||||||
|
"/actions/main/in/YAxisLockToggle" : "Y-Axis Lock Toggle",
|
||||||
|
"/actions/main/in/ZAxisLockToggle" : "Z-Axis Lock Toggle",
|
||||||
|
|
||||||
"/actions/main/in/PushToTalk" : "Push To Talk"
|
"/actions/main/in/PushToTalk" : "Push To Talk"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1248,6 +1248,57 @@ void MoveCenterTabController::snapTurnRight( bool snapTurnRightJustPressed )
|
|||||||
setRotation( newRotationAngleDeg );
|
setRotation( newRotationAngleDeg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::xAxisLockToggle( bool xAxisLockToggleJustPressed )
|
||||||
|
{
|
||||||
|
if ( !xAxisLockToggleJustPressed )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !m_lockXToggle )
|
||||||
|
{
|
||||||
|
setLockX( true );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setLockX( false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::yAxisLockToggle( bool yAxisLockToggleJustPressed )
|
||||||
|
{
|
||||||
|
if ( !yAxisLockToggleJustPressed )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !m_lockYToggle )
|
||||||
|
{
|
||||||
|
setLockY( true );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setLockY( false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::zAxisLockToggle( bool zAxisLockToggleJustPressed )
|
||||||
|
{
|
||||||
|
if ( !zAxisLockToggleJustPressed )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !m_lockZToggle )
|
||||||
|
{
|
||||||
|
setLockZ( true );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setLockZ( false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// END of other bindings
|
// END of other bindings
|
||||||
|
|
||||||
void MoveCenterTabController::updateHmdRotationCounter(
|
void MoveCenterTabController::updateHmdRotationCounter(
|
||||||
|
|||||||
@@ -170,6 +170,9 @@ public:
|
|||||||
void resetOffsets( bool resetOffsetsJustPressed );
|
void resetOffsets( bool resetOffsetsJustPressed );
|
||||||
void snapTurnLeft( bool snapTurnLeftJustPressed );
|
void snapTurnLeft( bool snapTurnLeftJustPressed );
|
||||||
void snapTurnRight( bool snapTurnRightJustPressed );
|
void snapTurnRight( bool snapTurnRightJustPressed );
|
||||||
|
void xAxisLockToggle( bool xAxisLockToggleJustPressed );
|
||||||
|
void yAxisLockToggle( bool yAxisLockToggleJustPressed );
|
||||||
|
void zAxisLockToggle( bool zAxisLockToggleJustPressed );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
int trackingUniverse() const;
|
int trackingUniverse() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user