Beispiel #1
0
        public void Init(string path, string title)
        {
            filePath = $"{path}{title}_{j_Prefix()}.json";
            JsonFileWriter.WriteDataToFile(path: filePath, text: "", title: "screenPosData", lastFrame: false);


            //screen space camera
            if (arCamera == null)
            {
                var cam = GameObject.FindGameObjectWithTag("MainCamera");
                arCamera = cam.GetComponent <Camera>();
            }

            if (arRaycastManager == null || arPlaneManager == null)
            {
                var sessionOrigin = GameObject.FindGameObjectWithTag("arSessionOrigin");
                arRaycastManager = sessionOrigin.GetComponent <ARRaycastManager>();
                arPlaneManager   = sessionOrigin.GetComponent <ARPlaneManager>();
                referenceCreator = sessionOrigin.GetComponent <ReferenceCreator>();
            }

            curTick      = 0;
            write        = false;
            jsonContents = "";
            //camera resolution to normalize screen pos data
            camera_width  = arCamera.pixelWidth;
            camera_height = arCamera.pixelHeight;
        }
Beispiel #2
0
 private void ClearCached()
 {
     m_CameraManager    = null;
     m_FaceManager      = null;
     m_PlaneManager     = null;
     m_ReferenceCreator = null;
     m_timeStamp        = 0.0f;
     trackTime          = false;
     faceAdded          = false;
     faceRemoved        = false;
     placedObject       = false;
     stateResetted      = false;
 }
Beispiel #3
0
        private void InitPlaneTrackingReferences()
        {
            //planeState = PlaneTrackingState.NewSession;
            m_CameraManager    = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <ARCameraManager>();
            m_PlaneManager     = GameObject.FindGameObjectWithTag("arSessionOrigin").GetComponent <ARPlaneManager>();
            m_ReferenceCreator = GameObject.FindGameObjectWithTag("arSessionOrigin").GetComponent <ReferenceCreator>();

            if (m_CameraManager != null & enabled)
            {
                m_CameraManager.frameReceived      += FrameChanged;
                m_CameraManager.lightEstimationMode = UnityEngine.XR.ARSubsystems.LightEstimationMode.AmbientIntensity;
            }
            if (m_ReferenceCreator != null & enabled)
            {
                m_ReferenceCreator.CreatedMarker += OnPlacedObject;
            }
        }
Beispiel #4
0
 public void Init(string path, string title)
 {
     filePath = $"{path}{title}_{j_Prefix()}.json";
     JsonFileWriter.WriteDataToFile(path: filePath, text: "", title: "anchorData", lastFrame: false);
     referenceCreator = GameObject.FindGameObjectWithTag("arSessionOrigin").GetComponent <ReferenceCreator>();
 }