Skip to content

Commit

Permalink
Implement grip pose input action for Oculus Touch controller's (#718)
Browse files Browse the repository at this point in the history
* 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 <hodgson.designs@gmail.com>
  • Loading branch information
FejZa and StephenHodgson committed Dec 16, 2020
1 parent 0f0b4a0 commit 0b4fd77
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public OculusTouchOpenVRController(IMixedRealityControllerDataProvider controlle
new MixedRealityInteractionMapping("Grip Pose", AxisType.SixDof, DeviceInputType.SpatialGrip)
};

/// <inheritdoc />
protected override MixedRealityPose GripPoseOffset => new MixedRealityPose(Vector3.zero, Quaternion.Euler(0f, 0f, -90f));

public override void UpdateController()
{
base.UpdateController();
Expand All @@ -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);
}
}
}

0 comments on commit 0b4fd77

Please sign in to comment.