Forum Discussion
741604688
8 years agoHonored Guest
I have a question,How do I lock HMD in Unity?
I don't want to make the picture changes,HMD rotate and move, HMD rotate and move, always show the current HMD current image.The HMD show only the pictures,Not rotate and move.What's the solution?
741604688
8 years agoHonored Guest
using UnityEngine;
using System.Collections;
public class FakeTracking : MonoBehaviour {
public OVRPose centerEyePose = OVRPose.identity;
public OVRPose leftEyePose = OVRPose.identity;
public OVRPose rightEyePose = OVRPose.identity;
public OVRPose leftHandPose = OVRPose.identity;
public OVRPose rightHandPose = OVRPose.identity;
public OVRPose trackerPose = OVRPose.identity;
void Awake()
{
OVRCameraRig rig = GameObject.FindObjectOfType<OVRCameraRig>();
if (rig != null)
rig.UpdatedAnchors += OnUpdatedAnchors;
}
void OnUpdatedAnchors(OVRCameraRig rig)
{
if (!enabled)
return;
//This doesn't work because VR camera poses are read-only.
//rig.centerEyeAnchor.FromOVRPose(OVRPose.identity);
//Instead, invert out the current pose and multiply in the desired pose.
OVRPose pose = rig.centerEyeAnchor.ToOVRPose(true).Inverse();
pose = centerEyePose * pose; rig.trackingSpace.FromOVRPose(pose, true);
//OVRPose referenceFrame = pose.Inverse();
//The rest of the nodes are updated by OVRCameraRig, not Unity, so they're easy.
rig.leftEyeAnchor.FromOVRPose(leftEyePose);
rig.rightEyeAnchor.FromOVRPose(rightEyePose);
rig.leftHandAnchor.FromOVRPose(leftHandPose);
rig.rightHandAnchor.FromOVRPose(rightHandPose);
rig.trackerAnchor.FromOVRPose(trackerPose);
}
}
Using FakeTracking script, screen will be shaking, The problem of jitter have a solution?
Using FakeTracking script, screen will be shaking, The problem of jitter have a solution?
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
- 1 year ago
- 9 months ago