Ejemplo n.º 1
0
        public ScientificCamera(CameraTypes cameraType, double width, double height)
        {
            Name = "Scientific Camera: " + count++;

            this.lastHeight = width;
            this.lastHeight = height;

            IPerspectiveCamera perspectiveCamera = this;
            perspectiveCamera.FieldOfView = 60f;
            perspectiveCamera.AspectRatio = width / height;
            perspectiveCamera.Near = 0.01;
            perspectiveCamera.Far = 10000;

            const int factor = 100;
            IOrthoCamera orthoCamera = this;
            orthoCamera.Left = -width / 2 / factor;
            orthoCamera.Right = width / 2 / factor;
            orthoCamera.Bottom = -height / 2 / factor;
            orthoCamera.Top = height / 2 / factor;
            orthoCamera.Near = -10000;
            orthoCamera.Far = 10000;

            this.Target = defaultTarget;
            this.Position = defaultPosition;
            this.UpVector = defaultUpVector;

            this.CameraType = cameraType;
        }
    public void changeCameraType(CameraTypes type)
    {
        if(type == CameraTypes.SINGLE_PERSON_CAMERA)
            transitionToSinglePersonCamera();

        if(type == CameraTypes.THIRD_PERSON_CAMERA)
            transitionToThirdPersonCamera();
    }
Ejemplo n.º 3
0
        private void SharpGLForm_Load(object sender, EventArgs e)
        {
            var cameraTypes = new CameraTypes[] { CameraTypes.Ortho, CameraTypes.Perspecitive };

            foreach (var item in cameraTypes)
            {
                this.cmbCameraType.Items.Add(item);
            }
        }
Ejemplo n.º 4
0
 public ComponentCamera(CameraTypes pCameraType, float pFov, float pRenderLong, float pRenderShort, float pWidth, float pHeight, Vector3 pOffset)
 {
     CameraType = pCameraType;
     Changed    = true;
     Projection = Matrix4.CreatePerspectiveFieldOfView(MathHelper.DegreesToRadians(pFov), pWidth / pHeight, pRenderShort, pRenderLong);
     Num        = NUM_CAMS;
     Offset     = pOffset;
     NUM_CAMS++;
 }
Ejemplo n.º 5
0
        public void Initialize(CameraTypes cameraType, RectTransform container, Vector2Int resolution)
        {
            _cameraType = cameraType;
            _container  = container;
            _resolution = resolution;

            _containerResolutionRatio = _container.rect.size / _resolution;

            SetSubscription();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Возвращает идентификационно имя камеры определнного типа
        /// </summary>
        public string GetName(CameraTypes cameraType)
        {
            var info = identificationData.FirstOrDefault(d => d.cameraType == cameraType);

            if (info == default)
            {
                throw new Exception($"Can't find CameraInfo of \"{cameraType.GetDescription()}\" CameraType");
            }

            return(info.nameIdentity);
        }
Ejemplo n.º 7
0
 private void ChangeCamera(CameraTypes type)
 {
     if (type == CameraTypes.Free)
     {
         SetCameraEnable(FreeCamera);
     }
     else if (type == CameraTypes.Front)
     {
         SetCameraEnable(FrontCamera);
     }
     else if (type == CameraTypes.Back)
     {
         SetCameraEnable(BackCamera);
     }
     CurrentSettings.CameraType = type;
 }
Ejemplo n.º 8
0
    void Update()
    {
        GetComponent <Camera>().orthographic = false;
        if (Input.GetKeyDown(KeyCode.C))
        {
            switch (cameraType)
            {
            case CameraTypes.Following:
                cameraType = CameraTypes.playerChangable;
                break;

            case CameraTypes.playerChangable:
                cameraType = CameraTypes.Static;
                break;

            case CameraTypes.Static:
                cameraType = CameraTypes.FollowingOrtho;
                break;

            case CameraTypes.FollowingOrtho:
                cameraType = CameraTypes.Following;
                break;
            }
        }
        switch (cameraType)
        {
        case CameraTypes.Following:
            Following();
            break;

        case CameraTypes.playerChangable:
            playerChangable();
            break;

        case CameraTypes.Static:
            Static();
            break;

        case CameraTypes.FollowingOrtho:
            FollowingOrtho();
            break;
        }
    }
Ejemplo n.º 9
0
 public void ChangeCamera(CameraTypes type)
 {
     if (type == CameraTypes.Free)
     {
         SetCameraEnable(FreeCamera);
     }
     else if (type == CameraTypes.Front)
     {
         SetCameraEnable(FrontCamera);
     }
     else if (type == CameraTypes.Back)
     {
         SetCameraEnable(BackCamera);
     }
     else if (type == CameraTypes.PositionFixed)
     {
         SetCameraEnable(PositionFixedCamera);
     }
     Settings.Current.CameraType = type;
 }
Ejemplo n.º 10
0
 public CameraTypes UpdateCameraType(CameraTypes cameraTypes)
 {
     return(_cameraTypesDal.Update(cameraTypes));
 }
Ejemplo n.º 11
0
 public void DeleteCameraType(CameraTypes cameraTypes)
 {
     _cameraTypesDal.Delete(cameraTypes);
 }
Ejemplo n.º 12
0
 public CameraTypes AddCameraType(CameraTypes cameraTypes)
 {
     return(_cameraTypesDal.Add(cameraTypes));
 }
Ejemplo n.º 13
0
 public CameraState(CameraTypes type) : this()
 {
     Type = type;
 }
Ejemplo n.º 14
0
 public static BaseCamera Create(CameraTypes type, params object[] args)
 {
     return((BaseCamera)Activator.CreateInstance(CameraTypes[type], args));
 }
Ejemplo n.º 15
0
 public void Initialize(CameraTypes cameraType)
 {
     SetSubscription();
     _cameraType          = cameraType;
     _webCamFrameRateWait = new WaitForSeconds(1f / Params.WEB_CAM_FPS);
 }