Skip to content

Commit 3d63ae2

Browse files
committed
v1.0.1
Hololens (RS4) Windows SDK 10.0.17134 Unity 2017.4.3f1 HoloToolkit-Unity-2017.4.0.0
1 parent 93aab3c commit 3d63ae2

31 files changed

+1210
-29361
lines changed

Assets/HoloLensWithOpenCVForUnityExample/HoloLensArUcoExample/HoloLensArUcoCameraCalibrationExample.cs

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@
77
using System.IO;
88
using System.Linq;
99
using UnityEngine.EventSystems;
10+
using HoloToolkit.Unity.InputModule;
1011

1112
#if UNITY_2017_2_OR_NEWER
1213
using UnityEngine.XR.WSA.Input;
1314
#else
1415
using UnityEngine.VR.WSA.Input;
1516
#endif
1617

17-
#if UNITY_5_3 || UNITY_5_3_OR_NEWER
18-
using UnityEngine.SceneManagement;
19-
#endif
2018
using OpenCVForUnity;
2119

2220
namespace HoloLensWithOpenCVForUnityExample
@@ -30,7 +28,7 @@ namespace HoloLensWithOpenCVForUnityExample
3028
/// https://docs.opencv.org/3.4.0/d7/d21/tutorial_interactive_calibration.html
3129
/// </summary>
3230
[RequireComponent(typeof(HololensCameraStreamToMatHelper))]
33-
public class HoloLensArUcoCameraCalibrationExample : MonoBehaviour
31+
public class HoloLensArUcoCameraCalibrationExample : ExampleSceneBase
3432
{
3533
/// <summary>
3634
/// The preview quad.
@@ -207,6 +205,10 @@ public class HoloLensArUcoCameraCalibrationExample : MonoBehaviour
207205
// Use this for initialization
208206
IEnumerator Start ()
209207
{
208+
camera = FindObjectOfType<HoloToolkit.Unity.InputModule.MixedRealityCameraManager>();
209+
cursor = FindObjectOfType<HoloToolkit.Unity.InputModule.Cursor>();
210+
input = FindObjectOfType<HoloToolkit.Unity.InputModule.InputManager>();
211+
210212
webCamTextureToMatHelper = gameObject.GetComponent<HololensCameraStreamToMatHelper> ();
211213

212214
// fix the screen orientation.
@@ -897,11 +899,7 @@ void OnDestroy ()
897899
/// </summary>
898900
public void OnBackButtonClick ()
899901
{
900-
#if UNITY_5_3 || UNITY_5_3_OR_NEWER
901-
SceneManager.LoadScene ("HoloLensWithOpenCVForUnityExample");
902-
#else
903-
Application.LoadLevel ("HoloLensWithOpenCVForUnityExample");
904-
#endif
902+
LoadScene ("HoloLensWithOpenCVForUnityExample");
905903
}
906904

907905
/// <summary>
@@ -1128,8 +1126,10 @@ private void OnTappedEvent (TappedEventArgs args)
11281126
private void OnTappedEvent (InteractionSourceKind source, int tapCount, Ray headRay)
11291127
#endif
11301128
{
1131-
if (EventSystem.current.IsPointerOverGameObject ())
1129+
// Determine if a Gaze pointer is over a GUI.
1130+
if (GazeManager.Instance.HitObject != null && GazeManager.Instance.HitObject.transform.name == "Text") {
11321131
return;
1132+
}
11331133

11341134
OnCaptureButtonClick ();
11351135
}

0 commit comments

Comments
 (0)