protected override void PendInputs(AirVRInputStream inputStream) { inputStream.PendTransform(this, (byte)AirVRTrackedControllerKey.Transform, _armModel.ControllerPositionFromHead, _armModel.ControllerRotationFromHead); inputStream.PendTouch(this, (byte)AirVRTrackedControllerKey.Touchpad, GvrControllerInput.IsTouching ? translateTouchPos(GvrControllerInput.TouchPos) : Vector2.zero, GvrControllerInput.IsTouching); inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonTouchpad, GvrControllerInput.ClickButton); inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonBack, GvrControllerInput.AppButton); }
protected override void PendInputs(AirVRInputStream inputStream) { inputStream.PendTouch(this, (byte)AirVRTouchpadKey.Touchpad, OVRInput.Get(OVRInput.RawAxis2D.LTouchpad, OVRInput.Controller.Touchpad), OVRInput.Get(OVRInput.RawTouch.LTouchpad, OVRInput.Controller.Touchpad)); // workaround : avoid bugs in OVRInput for important inputs inputStream.PendButton(this, (byte)AirVRTouchpadKey.ButtonBack, Input.GetKey(KeyCode.Escape)); inputStream.PendButton(this, (byte)AirVRTouchpadKey.ButtonUp, OVRInput.Get(OVRInput.RawButton.DpadUp, OVRInput.Controller.Touchpad)); inputStream.PendButton(this, (byte)AirVRTouchpadKey.ButtonDown, OVRInput.Get(OVRInput.RawButton.DpadDown, OVRInput.Controller.Touchpad)); inputStream.PendButton(this, (byte)AirVRTouchpadKey.ButtonLeft, OVRInput.Get(OVRInput.RawButton.DpadLeft, OVRInput.Controller.Touchpad)); inputStream.PendButton(this, (byte)AirVRTouchpadKey.ButtonRight, OVRInput.Get(OVRInput.RawButton.DpadRight, OVRInput.Controller.Touchpad)); }
protected override void PendInputs(AirVRInputStream inputStream) { bool leftHanded = (OVRInput.GetConnectedControllers() & OVRInput.Controller.LTrackedRemote) != 0; OVRInput.Controller controller = OVRInput.Controller.LTrackedRemote | OVRInput.Controller.RTrackedRemote; inputStream.PendTransform(this, (byte)AirVRTrackedControllerKey.Transform, OVRInput.GetLocalControllerPosition(leftHanded ? OVRInput.Controller.LTrackedRemote : OVRInput.Controller.RTrackedRemote), OVRInput.GetLocalControllerRotation(leftHanded ? OVRInput.Controller.LTrackedRemote : OVRInput.Controller.RTrackedRemote)); inputStream.PendTouch(this, (byte)AirVRTrackedControllerKey.Touchpad, OVRInput.Get(leftHanded ? OVRInput.RawAxis2D.LTouchpad : OVRInput.RawAxis2D.RTouchpad, controller), OVRInput.Get(leftHanded ? OVRInput.RawTouch.LTouchpad : OVRInput.RawTouch.RTouchpad, controller)); inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonTouchpad, OVRInput.Get(leftHanded ? OVRInput.RawButton.LTouchpad : OVRInput.RawButton.RTouchpad, controller)); // workaround : avoid bugs in OVRInput for important inputs inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonBack, OVRInput.Get(OVRInput.Button.Back)); inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonIndexTrigger, OVRInput.Get(leftHanded ? OVRInput.RawButton.LIndexTrigger : OVRInput.RawButton.RIndexTrigger, controller)); inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonUp, OVRInput.Get(OVRInput.RawButton.DpadUp, controller)); inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonDown, OVRInput.Get(OVRInput.RawButton.DpadDown, controller)); inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonLeft, OVRInput.Get(OVRInput.RawButton.DpadLeft, controller)); inputStream.PendButton(this, (byte)AirVRTrackedControllerKey.ButtonRight, OVRInput.Get(OVRInput.RawButton.DpadRight, controller)); }
protected override void PendInputs(AirVRInputStream inputStream) { inputStream.PendAxis2D(this, (byte)AirVRGamepadKey.Axis2DLThumbstick, OVRInput.Get(OVRInput.RawAxis2D.LThumbstick, OVRInput.Controller.Gamepad)); inputStream.PendAxis2D(this, (byte)AirVRGamepadKey.Axis2DRThumbstick, OVRInput.Get(OVRInput.RawAxis2D.RThumbstick, OVRInput.Controller.Gamepad)); inputStream.PendAxis(this, (byte)AirVRGamepadKey.AxisLIndexTrigger, OVRInput.Get(OVRInput.RawAxis1D.LIndexTrigger, OVRInput.Controller.Gamepad)); inputStream.PendAxis(this, (byte)AirVRGamepadKey.AxisRIndexTrigger, OVRInput.Get(OVRInput.RawAxis1D.RIndexTrigger, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonA, OVRInput.Get(OVRInput.RawButton.A, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonB, OVRInput.Get(OVRInput.RawButton.B, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonX, OVRInput.Get(OVRInput.RawButton.X, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonY, OVRInput.Get(OVRInput.RawButton.Y, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonStart, OVRInput.Get(OVRInput.RawButton.Start, OVRInput.Controller.Gamepad)); // workaround : avoid bugs in OVRInput for important inputs inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonBack, OVRInput.Get(OVRInput.Button.Back)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonLShoulder, OVRInput.Get(OVRInput.RawButton.LShoulder, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonRShoulder, OVRInput.Get(OVRInput.RawButton.RShoulder, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonLThumbstick, OVRInput.Get(OVRInput.RawButton.LThumbstick, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonRThumbstick, OVRInput.Get(OVRInput.RawButton.RThumbstick, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonDpadUp, OVRInput.Get(OVRInput.RawButton.DpadUp, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonDpadDown, OVRInput.Get(OVRInput.RawButton.DpadDown, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonDpadLeft, OVRInput.Get(OVRInput.RawButton.DpadLeft, OVRInput.Controller.Gamepad)); inputStream.PendButton(this, (byte)AirVRGamepadKey.ButtonDpadRight, OVRInput.Get(OVRInput.RawButton.DpadRight, OVRInput.Controller.Gamepad)); }