Skip to main content

SteamVRInputController

A class in Root.Township, the global namespace.

Reads SteamVR input actions (action set a_township_tale) for one hand and fills the game's ControllerInput, sets the hand pose and plays haptics. Client only.

Constructors​

MemberWhat it is
SteamVRInputController(PlayerInput controller)Creates a SteamVRInputController from controller.

Fields​

27 private and internal fields
MemberWhat it is
private SteamVR_Action_Boolean assistGrabActionAssistGrab action, fills GrabAssist.
private SteamVR_Action_Vector2 gesturesGestures 2D action.
private SteamVR_Action_Boolean grabActionGrab action.
private SteamVR_Action_Single grabStrengthActionGrabStrength axis; above 0.5 counts as a hard grab. Full strength if the action is inactive.
private SteamVR_Action_Vibration hapticHaptic vibration action.
private SteamVR_Input_Sources inputSourceWhich hand this controller reads (left or right).
private SteamVR_Action_Boolean itemLeftActionItemToTheLeft action, sends an item to the left.
private SteamVR_Action_Boolean itemRightActionItemToTheRight action, sends an item to the right.
private SteamVR_Action_Vector2 joystickDpadJoystickDpad 2D action; a sideways push also sends items and snap turns.
private SteamVR_Action_Boolean lockForGesturesActionLockforGestures action.
private SteamVR_Action_Boolean metaMenuActionMenu action, opens the meta menu.
private SteamVR_Action_Pose poseActionPose action for the hand's position, rotation and velocity.
private SteamVR_Action_Boolean releaseToggleGrabActionReleaseToggleGrab action.
private SteamVR_Action_Skeleton skeletonHand skeleton action for this hand, used for finger curls.
private SteamVR_Action_Vector2 smoothLocomotionSmoothLocomotion 2D action.
private SteamVR_Action_Vector2 smoothRotationSpeedSmoothRotationSpeed 2D action; its x size sets the smooth turn speed.
private SteamVR_Action_Single squeezeActionSqueeze axis, fills GrabAxis.
private SteamVR_Action_Vector2 swipeMotionSwipeMotion 2D action; whether it's active decides HasSwipe.
private SteamVR_Action_Boolean swipeTouchActionSwipeTouch action.
private SteamVR_Action_Boolean takeScreenshotActionTakePhoto action.
private SteamVR_Action_Boolean takeScreenshotLongActiontakephotolonghold action, also triggers a photo.
private SteamVR_Action_Boolean teleportActionTeleport action.
private SteamVR_Action_Boolean toggleGrabActionToggleGrab action.
private SteamVR_Action_Boolean toggleGrabActionDoubleTapToggleGrabDoubleTap action; a double tap also toggles grab.
private SteamVR_Action_Boolean toggleRunActionToggleRun action.
private SteamVR_Action_Boolean turnLeftActionTurnLeft snap turn action.
private SteamVR_Action_Boolean turnRightActionTurnRight snap turn action.

Methods​

MemberWhat it is
override void TriggerHaptics(float strength, float frequency, float remainingTime)Plays a vibration on this hand.
override void UpdatePosition()Moves the hand's target transform to the SteamVR pose, with the player height fix added.
protected override void PopulateInput(ControllerInput input)Copies every action state for this hand into ControllerInput, including finger curls (which also count as grab) and joystick left or right as item send and snap turn.
1 private and internal method
MemberWhat it is
private void GetAction<T>(out T action, string name)Looks up a SteamVR action by name in the a_township_tale action set.