コード例 #1
0
        protected override void Start()
        {
            base.Start();

            if (_deviceOffsetMode == DeviceOffsetMode.Transform && _deviceOrigin == null)
            {
                Debug.LogError("Cannot use the Transform device offset mode without " +
                               "specifying a Transform to use as the device origin.", this);
                _deviceOffsetMode = DeviceOffsetMode.Default;
            }

            if (Application.isPlaying && _mainCamera == null && _temporalWarpingMode != TemporalWarpingMode.Off)
            {
                Debug.LogError("Cannot perform temporal warping with no pre-cull camera.");
            }

            //Get the local tracked pose from the XR Headset so we can calculate the _trackingBaseDeltaPose from it
            var trackedPose = new Pose(XRSupportUtil.GetXRNodeCenterEyeLocalPosition(), XRSupportUtil.GetXRNodeCenterEyeLocalRotation());

            //Find the pose delta from the "local" tracked pose to the actual camera pose, we will use this later on to maintain offsets
            if (!_trackingBaseDeltaPose.HasValue)
            {
                _trackingBaseDeltaPose = _mainCamera.transform.ToLocalPose().mul(trackedPose.inverse());
            }
        }
コード例 #2
0
 protected override void Start()
 {
     base.Start();
     _cachedCamera = GetComponent <Camera>();
     if (_deviceOffsetMode == DeviceOffsetMode.Transform && _deviceOrigin == null)
     {
         Debug.LogError("Cannot use the Transform device offset mode without " +
                        "specifying a Transform to use as the device origin.", this);
         _deviceOffsetMode = DeviceOffsetMode.Default;
     }
 }
コード例 #3
0
        protected override void Start()
        {
            base.Start();
            _cachedCamera = GetComponent <Camera>();
            if (_deviceOffsetMode == DeviceOffsetMode.Transform && _deviceOrigin == null)
            {
                Debug.LogError("Cannot use the Transform device offset mode without " +
                               "specifying a Transform to use as the device origin.", this);
                _deviceOffsetMode = DeviceOffsetMode.Default;
            }

            if (Application.isPlaying && preCullCamera == null &&
                _temporalWarpingMode != TemporalWarpingMode.Off)
            {
                Debug.LogError("Cannot perform temporal warping with no pre-cull camera.");
            }
        }