Forum Discussion
levi777l
9 years agoExplorer
Multiple sensors in unity
The OVR Camera rig only has a anchor point for one sensor, how can I find the position of the rest?
4 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffUse OVRTracker.GetPose(..). Example:using UnityEngine;using System.Collections;using VR=UnityEngine.VR;public class OVRTrackedNode : MonoBehaviour{public enum Node{Head = VR.VRNode.Head,EyeLeft = VR.VRNode.LeftEye,EyeRight = VR.VRNode.RightEye,EyeCenter = VR.VRNode.CenterEye,HandLeft = VR.VRNode.LeftHand,HandRight = VR.VRNode.RightHand,TrackerZero,TrackerOne,TrackerTwo,TrackerThree,}public VR.VRNode node;void Update(){int trackerIndex = (int)node - (int)Node.TrackerZero;
OVRPose pose;if (trackerIndex >= 0 && trackerIndex <= 3){pose = OVRManager.tracker.GetPose(trackerIndex);}else{pose.orientation = VR.InputTracking.GetLocalRotation((VR.VRNode)node);pose.position = VR.InputTracking.GetLocalPosition((VR.VRNode)node);}transform.FromOVRPose(pose, true);}} - levi777lExplorerInteresting, I found the answer and couldn't delete my post, so I edited it and asked a different question I had. =P Thanks tho!
- vrdavebOculus StaffAny chance you could go back to the previous question in this thread and make a new thread for the new question? Other developers may benefit from the context.
- levi777lExplorerDone =P
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago