Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

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 authored Dec 16, 2020
1 parent 0c5e356 commit b15a4f9
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 b15a4f9

Please sign in to comment.