예제 #1
0
        //public void SetWalkAbout(int index, ProjectManager projectManager)
        //{
        //    _projectManager = projectManager;
        //    txtName.text = "Character Camera";
        //    txtType.text = "Walk Around Site";
        //    imgIcon.sprite = imgWalkAround;
        //    this.index = index;
        //    imgBackground.sprite = imgBackgroundNormal;
        //}

        public void SetData(Models.Camera camera, int index, ProjectManager projectManager, string type = null)
        {
            _camera         = camera;
            _projectManager = projectManager;
            txtName.text    = camera.name;
            switch (camera.cameraType)
            {
            case Models.CameraType.Projector:
                txtType.text   = "Physical Projector";
                imgIcon.sprite = imgProjector;
                break;

            case Models.CameraType.Virtual:
                txtType.text   = "Virtual Camera";
                imgIcon.sprite = imgCamera;
                break;

            case Models.CameraType.WalkAbout:
                txtType.text   = "Walk About Camera";
                imgIcon.sprite = imgWalkAround;
                break;
            }
            if (!string.IsNullOrEmpty(type))
            {
                txtType.text = type;
            }
            this.index           = index;
            imgBackground.sprite = imgBackgroundNormal;
        }
 public void SetData(Models.Camera camera, int index, ProjectManager projectManager)
 {
     _camera         = camera;
     _projectManager = projectManager;
     this.index      = index;
     //set up the video capture
     SetupVideoCapture();
 }
 public void UpdateFovAndFocalLength(PI.ProjectionToolkit.Models.Camera camera)
 {
     this.camera.fieldOfView = camera.fieldOfView;
     this.camera.focalLength = camera.focalLength;
     settingUp = true;
     fieldOfView.SetData(this.camera.fieldOfView);
     focalLength.SetData(this.camera.focalLength);
     settingUp = false;
 }
 public void UpdateCamera(Models.Camera camera, bool changeFieldOfViewOverFocalLength, bool updateDisplay2, bool updateDisplay3, bool updateDisplay4)
 {
     if (!cameraItem.setToRecord)
     {
         this.camera = camera;
         this.camera.SetCamera(cameraItem.camera, changeFieldOfViewOverFocalLength);
         camera.fieldOfView = cameraItem.camera.fieldOfView;
         camera.focalLength = cameraItem.camera.focalLength;
         this.camera.SetTransform(this.cameraContainer);
     }
 }
 public void SetData(PI.ProjectionToolkit.Models.Camera camera, bool attachedToDisplay2, bool attachedToDisplay3, bool attachedToDisplay4)
 {
     settingUp   = true;
     this.camera = camera;
     posX.SetData(this.camera.position.x);
     posY.SetData(this.camera.position.y);
     posZ.SetData(this.camera.position.z);
     rotationX.SetData(this.camera.rotation.x);
     rotationY.SetData(this.camera.rotation.y);
     rotationZ.SetData(this.camera.rotation.z);
     fieldOfView.SetData(this.camera.fieldOfView);
     focalLength.SetData(this.camera.focalLength);
     sensorX.SetData(this.camera.sensorSize.x);
     sensorY.SetData(this.camera.sensorSize.y);
     lensShiftX.SetData(this.camera.lensShift.x);
     lensShiftY.SetData(this.camera.lensShift.y);
     checkDisplay2.isOn = attachedToDisplay2;
     checkDisplay3.isOn = attachedToDisplay3;
     checkDisplay4.isOn = attachedToDisplay4;
     settingUp          = false;
 }
        public void AddCamera(PI.ProjectionToolkit.Models.Camera camera, bool addHeader = false, bool addSubHeader = false, string header = "CAMERA")
        {
            if (addHeader)
            {
                AddHeader(header, addSubHeader);
            }
            AddTextLine("NAME", camera.name);
            AddTransform(camera, "");
            AddTextLine("FIELD OF VIEW", camera.fieldOfView);
            if (camera.cameraType == Models.CameraType.Projector)
            {
                AddTextLine("FOCAL LENGTH", camera.focalLength);
                AddTextLine("SENSOR SIZE", camera.sensorSize);
                AddTextLine("LENSE SHIFT", camera.lensShift);
                switch (camera.gateFit)
                {
                case UnityEngine.Camera.GateFitMode.Fill:
                    AddTextLine("LENSE SHIFT", "FILL");
                    break;

                case UnityEngine.Camera.GateFitMode.Horizontal:
                    AddTextLine("LENSE SHIFT", "HORIZONTAL");
                    break;

                case UnityEngine.Camera.GateFitMode.None:
                    AddTextLine("LENSE SHIFT", "NONE");
                    break;

                case UnityEngine.Camera.GateFitMode.Overscan:
                    AddTextLine("LENSE SHIFT", "OVERSCAN");
                    break;

                case UnityEngine.Camera.GateFitMode.Vertical:
                    AddTextLine("LENSE SHIFT", "VIRTICAL");
                    break;
                }
            }
            AddTextLine("CLIPPING PLANE - NEAR", camera.nearClipPlane);
            AddTextLine("CLIPPING PLANE - FAR", camera.nearClipPlane);
        }
예제 #7
0
        private ProjectCameraHolder AddCamera(Models.Camera camera, int index, string type)
        {
            //add list item
            var listItem       = Instantiate(prefabCameraListItem, objCameraList.transform);
            var cameraListItem = listItem.GetComponent <ProjectCameraListItem>();

            cameraListItem.SetData(camera, index, this, type);
            //add camera to cameras
            //GameObject prefab = prefabCameraItem;
            GameObject prefab = Instantiate(Resources.Load <GameObject>(_project.projectionSite.folder + "/" + camera.prefab), objModelContainer.transform);

            switch (camera.cameraType)
            {
            case Models.CameraType.WalkAbout:
                prefab = prefabCameraWalkAround;
                break;
            }
            var gameObject = Instantiate(prefab, objCamerasContainer.transform);

            gameObject.name = camera.name;
            //gameObject.SetActive(false);
            var cameraItem = gameObject.GetComponent <ProjectCameraItem>();

            cameraItem.SetData(camera, index, this);
            camera.SetTransform(gameObject);
            ProjectCameraHolder holder = new ProjectCameraHolder()
            {
                camera          = camera,
                cameraContainer = gameObject,
                cameraItem      = cameraItem,
                cameraListItem  = cameraListItem,
                projectManager  = this
            };

            holder.Setup();
            //do all the config for the camera
            return(holder);
        }
예제 #8
0
 private void CameraEditor_OnCameraChanged(Models.Camera camera, bool changeFieldOfViewOverFocalLength, bool updateDisplay2, bool updateDisplay3, bool updateDisplay4)
 {
     currentCameraHolder.UpdateCamera(camera, changeFieldOfViewOverFocalLength, updateDisplay2, updateDisplay3, updateDisplay4);
     cameraEditor.UpdateFovAndFocalLength(camera);
 }