Exemplo n.º 1
0
        // Called by GazeGestureManager when the user performs a tap gesture.
        public void OnSelect()
        {
            // On each tap gesture, toggle whether the user is in placing mode.
            placing = !placing;

            // If the user is in placing mode, display the spatial mapping mesh.
            if (placing)
            {
                foreach (Rigidbody rb in this.GetComponentsInChildren <Rigidbody>())
                {
                    rb.isKinematic = true;
                }
                spatialMappingManager.DrawVisualMeshes = true;

                Debug.Log(gameObject.name + " : Removing existing world anchor if any.");

                anchorManager.RemoveAnchor(gameObject);
            }
            // If the user is not in placing mode, hide the spatial mapping mesh.
            else
            {
                spatialMappingManager.DrawVisualMeshes = false;
                // Add world anchor when object placement is done.
                anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName);
                foreach (Rigidbody rb in this.GetComponentsInChildren <Rigidbody>())
                {
                    rb.isKinematic = false;
                }
            }
        }
Exemplo n.º 2
0
        public void OnInputClicked(InputEventData eventData)
        {
            // On each tap gesture, toggle whether the user is in placing mode.
            placing = !placing;

            // If the user is in placing mode, display the spatial mapping mesh.
            if (placing)
            {
                spatialMappingManager.DrawVisualMeshes = true;

                Debug.Log(gameObject.name + " : Removing existing world anchor if any.");

                // * Make sure anchor store is ready. Otherwise you will get "remove anchor called before anchor store is ready" warning.
                if (anchorManager.AnchorStore != null)
                {
                    anchorManager.RemoveAnchor(gameObject);
                }
            }
            // If the user is not in placing mode, hide the spatial mapping mesh.
            else
            {
                spatialMappingManager.DrawVisualMeshes = false;
                // Add world anchor when object placement is done.
                anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName);
                // * Automaticaly disable script after being placed.
                this.enabled = false;
            }
        }
Exemplo n.º 3
0
        // Called by GazeGestureManager when the user performs a tap gesture.
        public void OnSelect()
        {
            // On each tap gesture, toggle whether the user is in placing mode.
            placing = !placing;

            // If the user is in placing mode, display the spatial mapping mesh.
            if (placing)
            {
                spatialMappingManager.DrawVisualMeshes = true;

                Debug.Log(gameObject.name + " : Removing existing world anchor if any.");

                anchorManager.RemoveAnchor(gameObject);

                // 6-WORLD-COORDS - override the focused object so it moves with
                // your gaze as the cursor would
                GestureManager.Instance.OverrideFocusedObject = gameObject;
            }
            // If the user is not in placing mode, hide the spatial mapping mesh.
            else
            {
                spatialMappingManager.DrawVisualMeshes = false;
                // Add world anchor when object placement is done.
                anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName);

                // 6-WORLD-COORDS - enable physics on the bottles now that we
                // are placed. Also, clear overriding the focused object
                //var stack = GetComponentInChildren<StackedBottlesScript>();
                //stack.InitPhysics();
                //GestureManager.Instance.OverrideFocusedObject = null;
            }
        }
Exemplo n.º 4
0
        // Called by GazeGestureManager when the user performs a tap gesture.
        public void OnSelect()
        {
            if (FurnitureManipulationManager.IsManipulating && !placing)
            {
                return;
            }

            // On each tap gesture, toggle whether the user is in placing mode.
            placing = !placing;

            // If the user is in placing mode, display the spatial mapping mesh.
            if (placing)
            {
                FurnitureManipulationManager.IsManipulating = true;
                spatialMappingManager.DrawVisualMeshes      = true;

                Debug.Log(gameObject.name + " : Removing existing world anchor if any.");

                anchorManager.RemoveAnchor(gameObject);
                source.PlayOneShot(pickupSound);
            }
            // If the user is not in placing mode, hide the spatial mapping mesh.
            else
            {
                FurnitureManipulationManager.IsManipulating = false;
                spatialMappingManager.DrawVisualMeshes      = false;
                // Add world anchor when object placement is done.
                anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName);
                source.PlayOneShot(putdownSound);
            }
        }
Exemplo n.º 5
0
        // Called by GazeGestureManager when the user performs a tap gesture.
        public void OnSelect()
        {
            // On each tap gesture, toggle whether the user is in placing mode.
            placing = !placing;

            // If the user is in placing mode, display the spatial mapping mesh.
            if (placing)
            {
                spatialMappingManager.DrawVisualMeshes = true;

                Debug.Log(gameObject.name + " : Removing existing world anchor if any.");

                anchorManager.RemoveAnchor(gameObject);

                // delegate
                if (PlacingStart != null)
                {
                    PlacingStart.Invoke(gameObject);
                }
            }
            // If the user is not in placing mode, hide the spatial mapping mesh.
            else
            {
                spatialMappingManager.DrawVisualMeshes = false;
                // Add world anchor when object placement is done.
                anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName);

                // delegate
                if (PlacingEnd != null)
                {
                    PlacingEnd();
                }
            }
        }
Exemplo n.º 6
0
        public void OnInputClicked(InputEventData eventData)
        {
            // On each tap gesture, toggle whether the user is in placing mode.
            placing = !placing;

            // If the user is in placing mode, display the spatial mapping mesh.
            if (placing)
            {
                spatialMappingManager.DrawVisualMeshes = true;

                Debug.Log(gameObject.name + " : Removing existing world anchor if any.");

                anchorManager.RemoveAnchor(gameObject);
            }
            // If the user is not in placing mode, hide the spatial mapping mesh.
            else
            {
                spatialMappingManager.DrawVisualMeshes = false;
                // Add world anchor when object placement is done.
                anchorManager.AttachAnchor(gameObject, SavedAnchorFriendlyName);
            }
        }