Add actions and placeholder functions to movecentertab
This commit is contained in:
@@ -131,13 +131,13 @@ SteamIVRInput::SteamIVRInput()
|
|||||||
ActionType::Digital ),
|
ActionType::Digital ),
|
||||||
m_stopTrack( input_strings::k_actionStopTrack, ActionType::Digital ),
|
m_stopTrack( input_strings::k_actionStopTrack, ActionType::Digital ),
|
||||||
m_leftHandSpaceTurn( input_strings::k_actionLeftHandSpaceTurn,
|
m_leftHandSpaceTurn( input_strings::k_actionLeftHandSpaceTurn,
|
||||||
ActionType::Digital ),
|
ActionType::Digital ),
|
||||||
m_rightHandSpaceTurn( input_strings::k_actionRightHandSpaceTurn,
|
m_rightHandSpaceTurn( input_strings::k_actionRightHandSpaceTurn,
|
||||||
ActionType::Digital ),
|
ActionType::Digital ),
|
||||||
m_leftHandSpaceDrag( input_strings::k_actionLeftHandSpaceDrag,
|
m_leftHandSpaceDrag( input_strings::k_actionLeftHandSpaceDrag,
|
||||||
ActionType::Digital ),
|
|
||||||
m_rightHandSpaceDrag( input_strings::k_actionRightHandSpaceDrag,
|
|
||||||
ActionType::Digital ),
|
ActionType::Digital ),
|
||||||
|
m_rightHandSpaceDrag( input_strings::k_actionRightHandSpaceDrag,
|
||||||
|
ActionType::Digital ),
|
||||||
m_optionalOverrideLeftHandSpaceTurn(
|
m_optionalOverrideLeftHandSpaceTurn(
|
||||||
input_strings::k_actionOptionalOverrideLeftHandSpaceTurn,
|
input_strings::k_actionOptionalOverrideLeftHandSpaceTurn,
|
||||||
ActionType::Digital ),
|
ActionType::Digital ),
|
||||||
@@ -149,7 +149,23 @@ SteamIVRInput::SteamIVRInput()
|
|||||||
ActionType::Digital ),
|
ActionType::Digital ),
|
||||||
m_optionalOverrideRightHandSpaceDrag(
|
m_optionalOverrideRightHandSpaceDrag(
|
||||||
input_strings::k_actionOptionalOverrideRightHandSpaceDrag,
|
input_strings::k_actionOptionalOverrideRightHandSpaceDrag,
|
||||||
ActionType::Digital )
|
ActionType::Digital ),
|
||||||
|
m_swapSpaceDragToLeftHandOverride(
|
||||||
|
input_strings::k_actionSwapSpaceDragToLeftHandOverride,
|
||||||
|
ActionType::Digital ),
|
||||||
|
m_swapSpaceDragToRightHandOverride(
|
||||||
|
input_strings::k_actionSwapSpaceDragToRightHandOverride,
|
||||||
|
ActionType::Digital ),
|
||||||
|
m_gravityToggle( input_strings::k_actionGravityToggle,
|
||||||
|
ActionType::Digital ),
|
||||||
|
m_heightToggle( input_strings::k_actionHeightToggle,
|
||||||
|
ActionType::Digital ),
|
||||||
|
m_resetOffsets( input_strings::k_actionResetOffsets,
|
||||||
|
ActionType::Digital ),
|
||||||
|
m_snapTurnLeft( input_strings::k_actionSnapTurnLeft,
|
||||||
|
ActionType::Digital ),
|
||||||
|
m_snapTurnRight( input_strings::k_actionSnapTurnRight,
|
||||||
|
ActionType::Digital )
|
||||||
{
|
{
|
||||||
m_activeActionSet.ulActionSet = m_mainSet.handle();
|
m_activeActionSet.ulActionSet = m_mainSet.handle();
|
||||||
m_activeActionSet.ulRestrictedToDevice = vr::k_ulInvalidInputValueHandle;
|
m_activeActionSet.ulRestrictedToDevice = vr::k_ulInvalidInputValueHandle;
|
||||||
@@ -242,6 +258,43 @@ bool SteamIVRInput::optionalOverrideRightHandSpaceDrag()
|
|||||||
m_optionalOverrideRightHandSpaceDrag );
|
m_optionalOverrideRightHandSpaceDrag );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::swapSpaceDragToLeftHandOverride()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedConstant(
|
||||||
|
m_swapSpaceDragToLeftHandOverride );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::swapSpaceDragToRightHandOverride()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedConstant(
|
||||||
|
m_swapSpaceDragToRightHandOverride );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::gravityToggle()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedOnce( m_gravityToggle );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::heightToggle()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedOnce( m_heightToggle );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::resetOffsets()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedOnce( m_resetOffsets );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::snapTurnLeft()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedOnce( m_snapTurnLeft );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SteamIVRInput::snapTurnRight()
|
||||||
|
{
|
||||||
|
return isDigitalActionActivatedOnce( m_snapTurnRight );
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Updates the active action set(s).
|
Updates the active action set(s).
|
||||||
Should be called every frame, or however often you want the input system to
|
Should be called every frame, or however often you want the input system to
|
||||||
|
|||||||
@@ -48,6 +48,13 @@ public:
|
|||||||
bool optionalOverrideRightHandSpaceTurn();
|
bool optionalOverrideRightHandSpaceTurn();
|
||||||
bool optionalOverrideLeftHandSpaceDrag();
|
bool optionalOverrideLeftHandSpaceDrag();
|
||||||
bool optionalOverrideRightHandSpaceDrag();
|
bool optionalOverrideRightHandSpaceDrag();
|
||||||
|
bool swapSpaceDragToLeftHandOverride();
|
||||||
|
bool swapSpaceDragToRightHandOverride();
|
||||||
|
bool gravityToggle();
|
||||||
|
bool heightToggle();
|
||||||
|
bool resetOffsets();
|
||||||
|
bool snapTurnLeft();
|
||||||
|
bool snapTurnRight();
|
||||||
|
|
||||||
// Destructor. There are no terminating calls for the IVRInput API, so it
|
// Destructor. There are no terminating calls for the IVRInput API, so it
|
||||||
// is left blank.
|
// is left blank.
|
||||||
@@ -87,6 +94,13 @@ private:
|
|||||||
Action m_optionalOverrideRightHandSpaceTurn;
|
Action m_optionalOverrideRightHandSpaceTurn;
|
||||||
Action m_optionalOverrideLeftHandSpaceDrag;
|
Action m_optionalOverrideLeftHandSpaceDrag;
|
||||||
Action m_optionalOverrideRightHandSpaceDrag;
|
Action m_optionalOverrideRightHandSpaceDrag;
|
||||||
|
Action m_swapSpaceDragToLeftHandOverride;
|
||||||
|
Action m_swapSpaceDragToRightHandOverride;
|
||||||
|
Action m_gravityToggle;
|
||||||
|
Action m_heightToggle;
|
||||||
|
Action m_resetOffsets;
|
||||||
|
Action m_snapTurnLeft;
|
||||||
|
Action m_snapTurnRight;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -117,6 +131,15 @@ namespace input_strings
|
|||||||
= "/actions/main/in/OptionalOverrideLeftHandSpaceDrag";
|
= "/actions/main/in/OptionalOverrideLeftHandSpaceDrag";
|
||||||
constexpr auto k_actionOptionalOverrideRightHandSpaceDrag
|
constexpr auto k_actionOptionalOverrideRightHandSpaceDrag
|
||||||
= "/actions/main/in/OptionalOverrideRightHandSpaceDrag";
|
= "/actions/main/in/OptionalOverrideRightHandSpaceDrag";
|
||||||
|
constexpr auto k_actionSwapSpaceDragToLeftHandOverride
|
||||||
|
= "/actions/main/in/SwapSpaceDragToLeftHandOverride";
|
||||||
|
constexpr auto k_actionSwapSpaceDragToRightHandOverride
|
||||||
|
= "/actions/main/in/SwapSpaceDragToRightHandOverride";
|
||||||
|
constexpr auto k_actionGravityToggle = "/actions/main/in/GravityToggle";
|
||||||
|
constexpr auto k_actionHeightToggle = "/actions/main/in/HeightToggle";
|
||||||
|
constexpr auto k_actionResetOffsets = "/actions/main/in/ResetOffsets";
|
||||||
|
constexpr auto k_actionSnapTurnLeft = "/actions/main/in/SnapTurnLeft";
|
||||||
|
constexpr auto k_actionSnapTurnRight = "/actions/main/in/SnapTurnRight";
|
||||||
|
|
||||||
constexpr auto k_setMain = "/actions/main";
|
constexpr auto k_setMain = "/actions/main";
|
||||||
|
|
||||||
|
|||||||
@@ -493,12 +493,19 @@ void OverlayController::processInputBindings()
|
|||||||
// reorder these. Override actions must always come after normal because
|
// reorder these. Override actions must always come after normal because
|
||||||
// active priority is set based on which action is "newest"
|
// active priority is set based on which action is "newest"
|
||||||
// normal actions:
|
// normal actions:
|
||||||
m_moveCenterTabController.leftHandSpaceDrag( m_actions.leftHandSpaceDrag() );
|
m_moveCenterTabController.leftHandSpaceDrag(
|
||||||
|
m_actions.leftHandSpaceDrag() );
|
||||||
m_moveCenterTabController.rightHandSpaceDrag(
|
m_moveCenterTabController.rightHandSpaceDrag(
|
||||||
m_actions.rightHandSpaceDrag() );
|
m_actions.rightHandSpaceDrag() );
|
||||||
m_moveCenterTabController.leftHandSpaceTurn( m_actions.leftHandSpaceTurn() );
|
m_moveCenterTabController.leftHandSpaceTurn(
|
||||||
|
m_actions.leftHandSpaceTurn() );
|
||||||
m_moveCenterTabController.rightHandSpaceTurn(
|
m_moveCenterTabController.rightHandSpaceTurn(
|
||||||
m_actions.rightHandSpaceTurn() );
|
m_actions.rightHandSpaceTurn() );
|
||||||
|
m_moveCenterTabController.gravityToggle( m_actions.gravityToggle() );
|
||||||
|
m_moveCenterTabController.heightToggle( m_actions.heightToggle() );
|
||||||
|
m_moveCenterTabController.resetOffsets( m_actions.resetOffsets() );
|
||||||
|
m_moveCenterTabController.snapTurnLeft( m_actions.snapTurnLeft() );
|
||||||
|
m_moveCenterTabController.snapTurnRight( m_actions.snapTurnRight() );
|
||||||
|
|
||||||
// override actions:
|
// override actions:
|
||||||
m_moveCenterTabController.optionalOverrideLeftHandSpaceDrag(
|
m_moveCenterTabController.optionalOverrideLeftHandSpaceDrag(
|
||||||
@@ -509,6 +516,10 @@ void OverlayController::processInputBindings()
|
|||||||
m_actions.optionalOverrideLeftHandSpaceTurn() );
|
m_actions.optionalOverrideLeftHandSpaceTurn() );
|
||||||
m_moveCenterTabController.optionalOverrideRightHandSpaceTurn(
|
m_moveCenterTabController.optionalOverrideRightHandSpaceTurn(
|
||||||
m_actions.optionalOverrideRightHandSpaceTurn() );
|
m_actions.optionalOverrideRightHandSpaceTurn() );
|
||||||
|
m_moveCenterTabController.swapSpaceDragToLeftHandOverride(
|
||||||
|
m_actions.swapSpaceDragToLeftHandOverride() );
|
||||||
|
m_moveCenterTabController.swapSpaceDragToRightHandOverride(
|
||||||
|
m_actions.swapSpaceDragToRightHandOverride() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// vsync implementation:
|
// vsync implementation:
|
||||||
|
|||||||
@@ -65,6 +65,41 @@
|
|||||||
"name": "/actions/main/in/OptionalOverrideRightHandSpaceDrag",
|
"name": "/actions/main/in/OptionalOverrideRightHandSpaceDrag",
|
||||||
"requirement": "optional",
|
"requirement": "optional",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/SwapSpaceDragToLeftHandOverride",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/SwapSpaceDragToRightHandOverride",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/GravityToggle",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/HeightToggle",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/ResetOffsets",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/SnapTurnLeft",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "/actions/main/in/SnapTurnRight",
|
||||||
|
"requirement": "optional",
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"action_sets": [
|
"action_sets": [
|
||||||
@@ -87,10 +122,17 @@
|
|||||||
"/actions/main/in/RightHandSpaceTurn" : "Right Hand Space Turn",
|
"/actions/main/in/RightHandSpaceTurn" : "Right Hand Space Turn",
|
||||||
"/actions/main/in/LeftHandSpaceDrag" : "Left Hand Space Drag",
|
"/actions/main/in/LeftHandSpaceDrag" : "Left Hand Space Drag",
|
||||||
"/actions/main/in/RightHandSpaceDrag" : "Right Hand Space Drag",
|
"/actions/main/in/RightHandSpaceDrag" : "Right Hand Space Drag",
|
||||||
"/actions/main/in/OptionalOverrideLeftHandSpaceTurn" : "Optional Override Left Hand Space Turn",
|
"/actions/main/in/OptionalOverrideLeftHandSpaceTurn" : "(Optional Override) Left Hand Space Turn",
|
||||||
"/actions/main/in/OptionalOverrideRightHandSpaceTurn" : "Optional Override Right Hand Space Turn",
|
"/actions/main/in/OptionalOverrideRightHandSpaceTurn" : "(Optional Override) Right Hand Space Turn",
|
||||||
"/actions/main/in/OptionalOverrideLeftHandSpaceDrag" : "Optional Override Left Hand Space Drag",
|
"/actions/main/in/OptionalOverrideLeftHandSpaceDrag" : "(Optional Override) Left Hand Space Drag",
|
||||||
"/actions/main/in/OptionalOverrideRightHandSpaceDrag" : "Optional Override Right Hand Space Drag"
|
"/actions/main/in/OptionalOverrideRightHandSpaceDrag" : "(Optional Override) Right Hand Space Drag",
|
||||||
|
"/actions/main/in/SwapSpaceDragToLeftHandOverride" : "Swap Active Space Drag to Left Hand (Override)",
|
||||||
|
"/actions/main/in/SwapSpaceDragToRightHandOverride" : "Swap Active Space Drag to Right Hand (Override)",
|
||||||
|
"/actions/main/in/GravityToggle" : "Gravity Toggle",
|
||||||
|
"/actions/main/in/HeightToggle" : "Height Toggle",
|
||||||
|
"/actions/main/in/ResetOffsets" : "Reset Offsets",
|
||||||
|
"/actions/main/in/SnapTurnLeft" : "Snap-Turn Left",
|
||||||
|
"/actions/main/in/SnapTurnRight" : "Snap-Turn Right"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -956,6 +956,59 @@ void MoveCenterTabController::optionalOverrideRightHandSpaceTurn(
|
|||||||
|
|
||||||
// END of turn bindings.
|
// END of turn bindings.
|
||||||
|
|
||||||
|
// START of other bindings.
|
||||||
|
|
||||||
|
void MoveCenterTabController::swapSpaceDragToLeftHandOverride(
|
||||||
|
bool swapDragToLeftHand )
|
||||||
|
{
|
||||||
|
// temp set to false
|
||||||
|
swapDragToLeftHand = false;
|
||||||
|
// TODO STUFF
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::swapSpaceDragToRightHandOverride(
|
||||||
|
bool swapDragToRightHand )
|
||||||
|
{
|
||||||
|
// temp set to false
|
||||||
|
swapDragToRightHand = false;
|
||||||
|
// TODO STUFF
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::gravityToggle( bool gravityToggleJustPressed )
|
||||||
|
{
|
||||||
|
// temp set to false
|
||||||
|
gravityToggleJustPressed = false;
|
||||||
|
// TODO STUFF
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::heightToggle( bool heightToggleJustPressed )
|
||||||
|
{
|
||||||
|
// temp set to false
|
||||||
|
heightToggleJustPressed = false;
|
||||||
|
// TODO STUFF
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::resetOffsets( bool resetOffsetsJustPressed )
|
||||||
|
{
|
||||||
|
// temp set to false
|
||||||
|
resetOffsetsJustPressed = false;
|
||||||
|
// TODO STUFF
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::snapTurnLeft( bool snapTurnLeftJustPressed )
|
||||||
|
{
|
||||||
|
// temp set to false
|
||||||
|
snapTurnLeftJustPressed = false;
|
||||||
|
// TODO STUFF
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveCenterTabController::snapTurnRight( bool snapTurnRightJustPressed )
|
||||||
|
{
|
||||||
|
// temp set to false
|
||||||
|
snapTurnRightJustPressed = false;
|
||||||
|
// TODO STUFF
|
||||||
|
}
|
||||||
|
|
||||||
void MoveCenterTabController::updateHmdRotationCounter(
|
void MoveCenterTabController::updateHmdRotationCounter(
|
||||||
vr::TrackedDevicePose_t hmdPose,
|
vr::TrackedDevicePose_t hmdPose,
|
||||||
double angle )
|
double angle )
|
||||||
|
|||||||
@@ -150,6 +150,13 @@ public:
|
|||||||
void rightHandSpaceTurn( bool rightHandTurnActive );
|
void rightHandSpaceTurn( bool rightHandTurnActive );
|
||||||
void optionalOverrideLeftHandSpaceTurn( bool overrideLeftHandTurnActive );
|
void optionalOverrideLeftHandSpaceTurn( bool overrideLeftHandTurnActive );
|
||||||
void optionalOverrideRightHandSpaceTurn( bool overrideRightHandTurnActive );
|
void optionalOverrideRightHandSpaceTurn( bool overrideRightHandTurnActive );
|
||||||
|
void swapSpaceDragToLeftHandOverride( bool swapDragToLeftHandActive );
|
||||||
|
void swapSpaceDragToRightHandOverride( bool swapDragToRightHandActive );
|
||||||
|
void gravityToggle( bool gravityToggleJustPressed );
|
||||||
|
void heightToggle( bool heightToggleJustPressed );
|
||||||
|
void resetOffsets( bool resetOffsetsJustPressed );
|
||||||
|
void snapTurnLeft( bool snapTurnLeftJustPressed );
|
||||||
|
void snapTurnRight( bool snapTurnRightJustPressed );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
int trackingUniverse() const;
|
int trackingUniverse() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user