Exemple #1
0
    private void WalkSelection()
    {
        Collider col    = GazeManager.RaycastCollider();
        Vector3  newPos = GazeManager.RaycastPosition();

        if (GazeManager.RaycastUI() != null)
        {
            return;
        }

        if (col != null && col.gameObject.layer == 9)
        {
            walkSelTimer += Time.deltaTime;
            if (walkSelTimer >= preWalkSelTime)
            {
                UIManager.SetSelectionMarker(Mathf.Clamp01((walkSelTimer - preWalkSelTime) / (walkSelTime - preWalkSelTime)), walkToPos);
            }
            if (walkSelTimer >= walkSelTime)
            {
                agent.SetDestination(new Vector3(walkToPos.x, transform.position.y, walkToPos.z));
                UIManager.SetSelectionMarker(0, walkToPos);
                //walkSelTimer = 0;
                //newPos = Vector3.zero;
            }

            if (Vector3.Distance(newPos, walkToPos) >= corrDistance)
            {
                walkSelTimer = 0;
                walkToPos    = newPos;
                UIManager.SetSelectionMarker(0, walkToPos);
            }
        }
    }
    private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.Hit)
        {
            // Get the target object
            GameObject obj = gm.HitInfo.collider.gameObject;

            // Try and get a TTS Manager
            TextToSpeechManager tts = null;
            if (obj != null)
            {
                tts = obj.GetComponent <TextToSpeechManager>();
            }

            // If we have a text to speech manager on the target object, say something.
            // This voice will appear to emanate from the object.
            if (tts != null)
            {
//                tts.SpeakText("This voice should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.");
//                tts.SpeakText("The time is " + DateTime.Now.ToString("t"));
                tts.SpeakText("Your flow of 14 Patients starts from only one entry, which is ALVEOLOPLASTY. Overall, 28.57 % of Patients end at the main exit which is SURG TOOTH EXTRACT NEC (4 Patients). Then, there are CONT MECH VENT < 96 HRS with 2, and finally TOOTH EXTRACTION NEC with 2. ALVEOLOPLASTY: The Patients who began at ALVEOLOPLASTY and finished at SURG TOOTH EXTRACT NEC took only one relevant path: 2 Patients began at ALVEOLOPLASTY before ending at SURG TOOTH EXTRACT NEC. Out of the 4 Patients who began at ALVEOLOPLASTY and resulted at SURG TOOTH EXTRACT NEC, 25 % passed at OTHER GASTROSTOMY, REMOV GASTROSTOMY TUBE, OTHER ORTHODONTIC OPERAT. The Patients who began at ALVEOLOPLASTY and finished at PROSTHET DENTAL IMPLANT took only one relevant path: 1 Patients began at ALVEOLOPLASTY before ending, by a five times repetition, at PROSTHET DENTAL IMPLANT. Out of the 2 Patients who began at ALVEOLOPLASTY and resulted at PROSTHET DENTAL IMPLANT, 50 % passed at SURG TOOTH EXTRACT NEC. The Patients who began at ALVEOLOPLASTY and finished at CONT MECH VENT < 96 HRS took only one relevant path: 1 Patients began at ALVEOLOPLASTY, then to TOOTH EXTRACTION NEC and finally ending at CONT MECH VENT < 96 HRS. Out of the 2 Patients who began at ALVEOLOPLASTY and resulted at CONT MECH VENT < 96 HRS, 100 % passed at TOOTH EXTRACTION NEC, SPINAL TAP, AORTA - SUBCLV - CAROT BYPAS, HEAD / NECK VES RESEC-REPL, REP VESS W SYNTH PATCH, VENOUS CATH NEC, EXTRACORPOREAL CIRCULAT, CARDIOPULM RESUSCITA NOS, ARTERIAL CATHETERIZATION, INSERT ENDOTRACHEAL TUBE. The Patients who began at ALVEOLOPLASTY and finished at TOOTH EXTRACTION NEC took only one path: 2 Patients began at ALVEOLOPLASTY before ending at TOOTH EXTRACTION NEC. ALVEOLOPLASTY is the step that should be focused on to reduce the number of Patients who reach SURG TOOTH EXTRACT NEC");
            }
        }
    }
Exemple #3
0
    private void TargetMarkerSelectUpdate()
    {
        Graphic graphic = GazeManager.RaycastUI();

        if (graphic == null)
        {
            return;
        }

        if (graphic.Equals(UIManager.Instance.targetMarker))
        {
            if (UIManager.Target != null)
            {
                bool isKillable = UIManager.TargetType().IsSubclassOf(typeof(Killable));
                if (!isKillable)
                {
                    ToggleMoveState();
                }
                else
                {
                    playerState = PlayerState.SpellPick;
                    //UIManager.ShowStateWheel(isPlayer);
                    UIManager.ShowSpellWheel(isKillable);
                }
            }
        }
    }
    private void Update()
    {
        OldFocusGameObject = FocusGameObject;
        GazeManager _gazeManager = GazeManager.Instance;

        if (_gazeManager == null)
        {
            return;
        }
        FocusGameObject = null;
        if (_gazeManager.Hit)
        {
            RaycastHit _hitInfo = _gazeManager.HitInfo;
            if (_hitInfo.collider != null)
            {
                FocusGameObject = _hitInfo.collider.gameObject;
            }
        }

        if (FocusGameObject != OldFocusGameObject)
        {
            SendFocusState(FocusGameObject, true);
            SendFocusState(OldFocusGameObject, false);
        }
    }
    void Update()
    {
        GazeManager gazeManager = GazeManager.Instance;
        RaycastHit  hit         = gazeManager.HitInfo;
        GameObject  focused     = hit.collider.gameObject;

        if (!focused)
        {
            return;
        }


        hitMeshRenderer.material.SetVector("_GazeUV", new Vector4(hit.textureCoord.x, hit.textureCoord.y, 0.0f, 0.0f));
        Texture2D texture = hitMeshRenderer.material.mainTexture as Texture2D;

        Vector2 pixelUV = hit.textureCoord;

        pixelUV.x *= texture.width;
        pixelUV.y *= texture.height;


        texture.SetPixel((int)pixelUV.x, (int)pixelUV.y, Color.red);
        texture.Apply();

        // Move those two lines to Seperate heatmap script
        //texture.SetPixel((int)pixelUV.x, (int)pixelUV.y, Color.red);
        //texture.Apply();
    }
Exemple #6
0
    }                                                                       // Public property for gazeOver

    private void Awake()
    {
        // Set default references
        gazeManager     = GazeManager.Instance;
        interactiveItem = this.GetComponent <VRInteractiveItem>();
        selectionRadial = Camera.main.GetComponent <SelectionRadial>();
    }
    // Use this for initialization
    void Start()
    {
        gazeManager       = GetComponentInChildren <GazeManager>();
        gestureRecognizer = new GestureRecognizer();

        initGestures();
    }
Exemple #8
0
    private void Update()
    {
        rect.position = UIManager.InsideScreenPos(UIManager.TargetMarkerPosition(), rect.sizeDelta.x / 2);

        Graphic graphic = GazeManager.RaycastUI();

        if (graphic == null)
        {
            return;
        }

        if (graphic.Equals(buttWalk))
        {
            Debug.Log("Walk state");
            PlayerController.SetState(PlayerController.PlayerState.MoveState);
            CloseWheels();
        }
        else if (graphic.Equals(buttInter))
        {
            Debug.Log("Inter state");
            PlayerController.SetState(PlayerController.PlayerState.IdleState);
            CloseWheels();
        }
        else if (graphic.Equals(buttExit))
        {
            //Exit
            //Debug.Log("Exit");
            CloseWheels();
        }
    }
Exemple #9
0
    private void Update()
    {
        rect.position = UIManager.InsideScreenPos(UIManager.TargetMarkerPosition(), rect.sizeDelta.x / 2);

        Graphic graphic = GazeManager.RaycastUI();

        if (graphic == null)
        {
            return;
        }

        if (graphic.Equals(buttSpell1))
        {
            PlayerController.ThrowSpell(1);
            CloseWheel();
        }
        else if (graphic.Equals(buttSpell2))
        {
            PlayerController.ThrowSpell(2);
            CloseWheel();
        }
        else if (graphic.Equals(buttExit))
        {
            //Exit
            //Debug.Log("Exit");
            CloseWheel();
        }
    }
        public void StopRotation()
        {
            GazeManager gm = GazeManager.Instance;

            if (gm.HitObject != null && gm.HitObject.name == zoomedImage.name)
            {
                rotateDirection = DirectionEnum.None;
                if (logging)
                {
                    Debug.Log("Rotate: Finish at " + Time.time);
                    Debug.Log("Rotate: Object angle " + zoomedImage.gameObject.transform.eulerAngles.z + " at " + Time.time);
                }
            }
            else if (logging)
            {
                if (GazeManager.Instance.HitObject != null)
                {
                    Debug.Log("Rotate: Finish Missed Target: " + GazeManager.Instance.HitObject.name + " at " + Time.time);
                }
                else
                {
                    Debug.Log("Rotate: Finish Missed Target: null object " + Time.time);
                }
            }
        }
    // Use this for initialization
    void Start()
    {
        gazeManager  = this.gameObject.GetComponentInChildren <GazeManager>();
        focusManager = this.gameObject.GetComponentInChildren <FocusManager>();

        requestBoxInstance = Instantiate(requestBox);
        requestBoxInstance.SetActive(false);

        this.lineRendererObject = this.transform.Find("LineRenderer").gameObject;
        this.line1 = Instantiate(this.lineRendererObject).GetComponent <LineRenderer>();
        this.line2 = Instantiate(this.lineRendererObject).GetComponent <LineRenderer>();
        this.line3 = Instantiate(this.lineRendererObject).GetComponent <LineRenderer>();
        this.line4 = Instantiate(this.lineRendererObject).GetComponent <LineRenderer>();
        this.line5 = Instantiate(this.lineRendererObject).GetComponent <LineRenderer>();



        requestBoxInstance = Instantiate(requestBox);
        requestBoxInstance.SetActive(false);


        imageWidth  = ScreenshotManager.Instance.cameraWidth;
        imageHeight = ScreenshotManager.Instance.cameraHeight;

        //gazeManager.FocusedObjectChanged += new GazeManager.FocusedChangedDelegate(focusChanged);

        focusManager.PointerSpecificFocusChanged += new FocusManager.PointerSpecificFocusChangedMethod(focusChanged);
    }
Exemple #12
0
    private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.Hit)
        {
            // Get the target object
            GameObject obj = gm.HitInfo.collider.gameObject;

            // Try and get a TTS Manager
            TextToSpeechManager tts = null;
            if (obj != null)
            {
                tts = obj.GetComponent <TextToSpeechManager>();
            }

            // If we have a text to speech manager on the target object, say something.
            // This voice will appear to emanate from the object.
            if (tts != null)
            {
//                tts.SpeakText("This voice should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.");
                tts.SpeakText("The time is " + DateTime.Now.ToString("t"));
            }
        }
    }
Exemple #13
0
    private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.Hit)
        {
            // Get the target object
            GameObject obj = gm.HitInfo.collider.gameObject;

            // Try and get a TTS Manager
            TextToSpeechManager tts = null;
            if (obj != null)
            {
                tts = obj.GetComponent <TextToSpeechManager>();
            }

            // If we have a text to speech manager on the target object, say something.
            // This voice will appear to emanate from the object.
            if (tts != null)
            {
                // Get the name
                var voiceName = Enum.GetName(typeof(TextToSpeechVoice), tts.Voice);

                // Create message
                var msg = string.Format("This is the {0} voice. It should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.", voiceName);

                // Speak message
                tts.SpeakText(msg);
            }
        }
    }
    public void SelectObject()
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.HitObject == null || gm.HitObject.name != cube.name)
        {
            return;
        }
        else
        {
            colorCounter++;
            if (colorCounter % 3 == 2)
            {
                cube.GetComponent <Renderer>().material = green;
            }
            else if (colorCounter % 3 == 1)
            {
                cube.GetComponent <Renderer>().material = red;
            }
            else if (colorCounter % 3 == 0)
            {
                cube.GetComponent <Renderer>().material = blue;
            }
        }
    }
Exemple #15
0
        public void SelectObject()
        {
            GazeManager gm = GazeManager.Instance;

            if (!thermostatMoved)
            {
                temperatureReading.transform.localPosition = new Vector3(0.0f, 0.2f, 0.0f);
                thermostat.transform.position = new Vector3(0.0835f, -0.0835f, thermostat.transform.position.z);
                moveThermostatArmTo(armRotation);
                thermostat.transform.eulerAngles = new Vector3(0.0f, 180.0f, 0.0f);
                thermostatMoved = true;
            }
            else if (!calendar.gameObject.activeSelf)
            {
                if (gm.HitObject == null && logging)
                {
                    Debug.Log("Select: Missed Target: null object " + Time.time);
                }
                else if (gm.HitObject.name != thermostat.name)
                {
                    Debug.Log("Select: Missed Target: " + gm.HitObject.name);
                }
                else
                {
                    calendar.gameObject.SetActive(true);
                    viewport.gameObject.SetActive(true);
                    promptViewport.gameObject.SetActive(true);
                    if (logging)
                    {
                        Debug.Log("Select: Clicked Thermostat at " + Time.time);
                    }
                }
            }
        }
        void Start()
        {
            cursor      = GameObject.FindGameObjectWithTag("Cursor");
            gazeManager = GameObject.FindGameObjectWithTag("InputManager").GetComponent <GazeManager>();
            envelope    = GameObject.FindGameObjectWithTag("Envelope");

            InputManager.Instance.PushModalInputHandler(this.gameObject);
        }
    protected override void Awake()
    {
        defaultColor = GetComponent <Renderer>().material.color;
        defaultIcon  = transform.GetChild(0).GetComponent <Renderer>().material.color;
        gazeManager  = GameObject.Find("DefaultCursor").GetComponent <GazeManager>();

        Debug.Log("Awake: " + gameObject);
    }
    public void StopRotation()
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.HitObject != null && gm.HitObject.name == cube.name)
        {
            rotateDirection = DirectionEnum.None;
        }
    }
Exemple #19
0
    private int nonCollisionLayer = 5; //layer to not to be intersected in a raycast (5 = UI)

    // Use this for initialization
    void Start()
    {
        Driver  = EFPContainer.GetComponent <EFPDriver>();
        GazeMan = InputManager.GetComponent <GazeManager>();
        //GazeMan.RaycastLayerMasks = new LayerMask[] { ~nonCollisionLayer };

        hitPos        = new Vector3(0.0f, 0.0f, 0.0f); //initialize position of hit
        InfoDisp.text = "";
    }
Exemple #20
0
    // Update is called once per frame
    void Update()
    {
        if (isFocused)
        {
            GazeManager gazeManager = GazeManager.Instance;
            RaycastHit  hitInfo     = gazeManager.HitInfo;
            GameObject  focused     = hitInfo.collider.gameObject;
            if (focused != null)
            {
                //GameObject.Find("Managers").GetComponent<GameObjectManager>().setFocus(focused);
                //Renderer renderer = hitInfo.transform.GetComponent<MeshRenderer>();

                hitMeshRenderer.material.SetVector("_GazeUV", new Vector4(hitInfo.textureCoord.x, hitInfo.textureCoord.y, 0.0f, 0.0f));
                Texture2D texture = hitMeshRenderer.material.mainTexture as Texture2D;

                Vector2 pixelUV = hitInfo.textureCoord;
                pixelUV.x *= texture.width;
                pixelUV.y *= texture.height;
                Vector2 tiling = hitMeshRenderer.material.mainTextureScale;
                Color   color  = texture.GetPixel(Mathf.FloorToInt(pixelUV.x * tiling.x), Mathf.FloorToInt(pixelUV.y * tiling.y));
                //Debug.Log(color);
                // Move those two lines to Seperate heatmap script
                //texture.SetPixel((int)pixelUV.x, (int)pixelUV.y, Color.red);
                //texture.Apply();
                int index = FindIndexFromColor(color);
                if (index >= 0)
                {
                    foreach (GameObject o in objects)
                    {
                        o.SetActive(false);
                    }
                    foreach (Renderer r in POIMeshRenderer)
                    {
                        r.enabled = false;
                    }
                    objects[index].SetActive(true);
                    objects[index].GetComponent <Audio_Trigger>().playAudioAndTrigger();
                    //POIMeshRenderer[index].enabled = true;
                }
                else
                {
                    /*
                     * foreach (GameObject o in objects)
                     * {
                     *  o.SetActive(false);
                     * }
                     * foreach (Renderer r in POIMeshRenderer)
                     * {
                     *  r.enabled = false;
                     *
                     * }
                     */
                }
            }
        }
    }
Exemple #21
0
 private void Start()
 {
     Instance = this;
     //DontDestroyOnLoad(gameObject);
     //int a = 5;
     //OnSomething += () => Debug.Log(a + "x");
     //OnSomething += () => Debug.Log("xxx");
     //Debug.Log("Before event");
     //OnSomething();
 }
        private void Start()
        {
            started = true;

            InputManager.AssertIsInitialized();
            FocusManager.AssertIsInitialized();
            GazeManager.AssertIsInitialized();

            AddInputManagerListenerIfNeeded();
            FindCursorIfNeeded();
            ConnectBestAvailablePointer();
        }
Exemple #23
0
    public void Locate()
    {
        m_gazeManager = GazeManager.Instance;

        // Tapの検出 (Global)
        m_gr         = new GestureRecognizer();
        m_gr.Tapped += OnTapped;
        m_gr.StartCapturingGestures();

        // WorldAnchorを取得する
        WorldAnchorStore.GetAsync(AnchorStoreReady);
    }
 void Start()
 {
     fadeControl         = FadeScript.Instance;
     warper              = MixedRealityTeleport.Instance;
     animationController = GetComponentInChildren <Animator>();
     animationController.StopPlayback();
     animationController.speed = 0;
     gazeManager = GazeManager.Instance;
     ActiveMarker.SetActive(false);
     layerMask = 1 << (LayerMask.NameToLayer("Ignore Raycast"));
     layerMask = ~layerMask;
     Debug.Log(LayerMask.NameToLayer("Ignore Raycast"));
 }
Exemple #25
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        HUDLogController.QuickMessage("Gaze Manager Checking In");
    }
Exemple #26
0
        protected virtual void Start()
        {
            gazeManager = GazeManager.Instance;

            if (gazeManager == null)
            {
                Debug.LogError("Must have a GazeManager somewhere in the scene.");
            }

            if ((GazeManager.Instance.RaycastLayerMasks[0] & (1 << gameObject.layer)) != 0)
            {
                Debug.LogError("The cursor has a layer that is checked in the GazeManager's Raycast Layer Mask.  Change the cursor layer (e.g.: to Ignore Raycast) or uncheck the layer in GazeManager: " +
                               LayerMask.LayerToName(gameObject.layer));
            }
        }
Exemple #27
0
    UnitController GetGazedUnit()
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.FocusedObject)
        {
            // Get the target object
            GameObject     obj  = gm.FocusedObject;
            UnitController unit = obj.GetComponent <UnitController>();

            return(unit);
        }

        return(null);
    }
        protected virtual void Start()
        {
            gazeManager = GazeManager.Instance;

            if (gazeManager == null)
            {
                Debug.LogError("Must have a GazeManager somewhere in the scene.");
            }

            if ((GazeManager.Instance.RaycastLayerMask & (1 << gameObject.layer)) != 0)
            {
                Debug.LogError("The cursor has a layer that is checked in the GazeManager's Raycast Layer Mask.  Change the cursor layer (e.g.: to Ignore Raycast) or uncheck the layer in GazeManager: " +
                    LayerMask.LayerToName(gameObject.layer));
            }
        }
    private void SelectProcess()
    {
        GazeManager _gazeManager = GazeManager.Instance;

        if (_gazeManager != null && _gazeManager.Hit)
        {
            CursorStateCtr.m_state = CursorStateCtr.State.MoveCurrent;//双击选中物体的同时,更改m_state状态为MoveCurrent,这样为下一次的单击该物体的事件做准备
            RaycastHit _hitInfo = _gazeManager.HitInfo;
            if (_hitInfo.collider != null)
            {
                CursorStateCtr.distance    = _hitInfo.distance;
                CursorStateCtr.oldHitPos   = _hitInfo.point;
                CursorStateCtr.oldObjPos   = gameObject.transform.position;
                CursorStateCtr.oldObjScale = gameObject.transform.localScale;
                //CursorStateCtr.oldCenter = gameObject.GetComponent<MeshRenderer>().bounds.center;
            }
        }

        SelectedGameObject = gameObject;//SelectedGameObject每次双击选中不同模型时,变量存储新的选中模型
        if (!PositionIndicatorsManager.bManualMatch)
        {
            AdjustUIPanel.Instance.gameObject.SetActive(true); //??
        }
        for (int index = 0; index != InteractibleObject.Length; ++index)
        {
            if (InteractibleObject[index].gameObject != gameObject)
            {
                CancelProcess(InteractibleObject[index].gameObject);//???
            }
        }
        //the GUI of Panel actually don't need switch recognizer,so this can use for rotation
        Color materialColor = _selectedGameObject.GetComponent <MeshRenderer>().material.color;

        //if (materialColor.a > 0.6)
        //    materialColor.a = 0.5f;
        //else
        //    materialColor.a = 1f;
        materialColor.a = 0.5f;
        _selectedGameObject.GetComponent <MeshRenderer>().material.color = materialColor;

        SelectedPosition = _selectedGameObject.transform.position;
        SelectedRotation = _selectedGameObject.transform.rotation;
        SelectedScale    = _selectedGameObject.transform.localScale;

        //CursorStateCtr.Instance.MoveNear();
    }
    public void StartRotation(String direction)
    {
        GazeManager gm = GazeManager.Instance;

        if (GazeManager.Instance.HitObject != null && GazeManager.Instance.HitObject.name == cube.name)
        {
            switch (direction)
            {
            case "Left":
                rotateDirection = DirectionEnum.Left;
                break;

            case "Right":
                rotateDirection = DirectionEnum.Right;
                break;
            }
        }
    }
        public void SelectObject()
        {
            GazeManager gm = GazeManager.Instance;

            if (!fullImage.gameObject.activeSelf)
            {
                if (gm.HitObject == null && logging)
                {
                    Debug.Log("Select: Missed Target: null object " + Time.time);
                }
                else if (gm.HitObject.name != camera.name)
                {
                    Debug.Log("Select: Missed Target: " + gm.HitObject.name);
                }
                else
                {
                    fullImage.gameObject.SetActive(true);
                    if (logging)
                    {
                        Debug.Log("Select: Clicked camera at " + Time.time);
                    }
                }
            }
            else if (!zoomedImage.gameObject.activeSelf)
            {
                if (gm.HitObject == null && logging)
                {
                    Debug.Log("Select: Missed Target: null object " + Time.time);
                }
                else if (gm.HitObject.name != fullImage.gameObject.name)
                {
                    Debug.Log("Select: Missed Target: " + gm.HitObject.name);
                }
                else
                {
                    zoomedImage.gameObject.SetActive(true);
                    viewport.gameObject.SetActive(true);
                    if (logging)
                    {
                        Debug.Log("Select: Clicked full image at " + Time.time);
                    }
                }
            }
        }
 private void Start()
 {
     gazeManager = GazeManager.Instance;
     RegisterManagers();
 }