Ejemplo n.º 1
0
    // Use this for initialization
    void Awake()
    {
        //zedManager = gameObject.transform.parent.GetComponentInChildren<ZEDManager>();
        zedManager = ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01);
        LeftCamera = zedManager.GetLeftCameraTransform().gameObject.GetComponent <Camera>();

        Cursor.visible = true; //Make sure cursor is visible so we can click on the world accurately.
    }
Ejemplo n.º 2
0
    private void Awake()
    {
        if (!zedManager)
        {
            zedManager = ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01);
        }

        if (!camAnchor)
        {
            camAnchor = FindObjectOfType <CameraAnchor>();
        }

        SetUpBalls(false);
    }
    public void Reset() //When the Unity editor Reset button is used.
    {
        cameraManager = gameObject.GetComponentInParent <ZEDManager>();
        if (!cameraManager)
        {
            cameraManager = ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01);
        }

        if (cameraManager != null)
        {
            cameraManager.resolution = sl.RESOLUTION.HD1080;
            UnityEngine.Debug.Log("Resolution set to HD1080 for better result");
        }
        SetDefaultValues();
    }
Ejemplo n.º 4
0
 private void OnValidate()
 {
     //If the user changes the showObjectMask setting to true, warn them if its ZEDManager has objectDetection2DMask set to false, because masks won't show up.
     if (Application.isPlaying && showObjectMask != lastShowObjectMaskValue)
     {
         lastShowObjectMaskValue = showObjectMask;
         if (!zedManager)
         {
             zedManager = ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01);
         }
         if (showObjectMask == true && zedManager != null && zedManager.objectDetection2DMask == false)
         {
             UnityEngine.Debug.LogError("ZED2DObjectVisualizer has showObjectMask enabled, but its ZEDManager has objectDetection2DMask disabled. " +
                                        "objectDetection2DMask must be enabled when Object Detection is started or masks will not be visible.");
         }
     }
 }
Ejemplo n.º 5
0
    // Use this for initialization
    void Awake()
    {
        if (!zedManager)
        {
            ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01);
        }
        if (!cam)
        {
            cam = zedManager.GetLeftCamera();
        }

        zedManager.OnZEDReady += DrawFrustum;

        if (!nearPlaneLineRend)
        {
            nearPlaneLineRend = GetComponent <LineRenderer>();
        }

        CreateEdgeLinesAndPlanes();
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        if (ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01) != null)
        {
            ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_01).OnZEDReady += zedIsReady;
        }

        if (ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_02) != null)
        {
            ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_02).OnZEDReady += zedIsReady;
        }

        if (ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_03) != null)
        {
            ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_03).OnZEDReady += zedIsReady;
        }

        if (ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_04) != null)
        {
            ZEDManager.GetInstance(sl.ZED_CAMERA_ID.CAMERA_ID_04).OnZEDReady += zedIsReady;
        }
    }