From 0b4fd77b581ec87649dfab9848fccc3affd2ed38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Wed, 16 Dec 2020 19:54:16 +0100 Subject: [PATCH] Implement grip pose input action for Oculus Touch controller's (#718) * Add grip pose to default open vr mappings * Implement raising grip pose in OTouch OpenVR * Add grip pose offset * Move grip pose offset to BaseController * Add grip pose override for Oculus Touch OpenVR Co-authored-by: Stephen Hodgson --- .../Controllers/OpenVR/OculusTouchOpenVRController.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Runtime/Providers/Controllers/OpenVR/OculusTouchOpenVRController.cs b/Runtime/Providers/Controllers/OpenVR/OculusTouchOpenVRController.cs index ae1abb56f..619f60e97 100644 --- a/Runtime/Providers/Controllers/OpenVR/OculusTouchOpenVRController.cs +++ b/Runtime/Providers/Controllers/OpenVR/OculusTouchOpenVRController.cs @@ -67,6 +67,9 @@ public OculusTouchOpenVRController(IMixedRealityControllerDataProvider controlle new MixedRealityInteractionMapping("Grip Pose", AxisType.SixDof, DeviceInputType.SpatialGrip) }; + /// + protected override MixedRealityPose GripPoseOffset => new MixedRealityPose(Vector3.zero, Quaternion.Euler(0f, 0f, -90f)); + public override void UpdateController() { base.UpdateController(); @@ -91,8 +94,8 @@ private void UpdateSpatialGripData(MixedRealityInteractionMapping interactionMap { Debug.Assert(interactionMapping.AxisType == AxisType.SixDof); interactionMapping.PoseData = new MixedRealityPose( - CurrentControllerPose.Position + GripPoseOffset.Position, - Quaternion.Euler(CurrentControllerPose.Rotation.eulerAngles + GripPoseOffset.Rotation.eulerAngles)); + CurrentControllerPose.Position + CurrentControllerPose.Rotation * GripPoseOffset.Position, + CurrentControllerPose.Rotation * GripPoseOffset.Rotation); } } } \ No newline at end of file