コード例 #1
0
        //add clone...
        public override object Clone()
        {
            PawnCamera3D clone
                = new PawnCamera3D("clone - " + this.ID,
                    this.ObjectType,
                    (Transform3D)this.Transform3D.Clone(), //deep copy
                    (ProjectionParameters)this.ProjectionParameters.Clone(), //deep copy - contains "copy by value" types
                    this.Viewport); //shallow or deep?

            for (int i = 0; i < this.controllerList.Count; i++)
            {
                IController cloneController
                        = (IController)this.controllerList[i].Clone();
                cloneController.SetParentActor(clone);
                clone.Add(cloneController);
            }

            return clone;
        }
コード例 #2
0
        private void InitializeCamera()
        {
            Camera3D clone = null;
            Camera3D camera = null;
            PawnCamera3D pawnCamera = null;

            camera = new FreeLookCamera3D("full", ObjectType.FirstPersonCamera,
                   new Transform3D(new Vector3(-10, 5, 30), -Vector3.UnitZ, Vector3.UnitY),
                       ProjectionParameters.StandardMediumFourThree, this.graphics.GraphicsDevice.Viewport, GameData.CameraSpeed);

            #region Fullscreen
            this.cameraManager.Add("FirstPersonFullScreen", camera);
            #endregion

            #region RailCharacterFollow
            pawnCamera = new PawnCamera3D("RailCamera1",
                ObjectType.RailCamera, (Transform3D)Transform3D.Zero.Clone(),
                ProjectionParameters.StandardMediumFourThree, this.graphics.GraphicsDevice.Viewport);

            pawnCamera.Add(new RailCharacterFollowController("rail character follow controller 1",
                pawnCamera, true, new RailParameters("r1", new Vector3(-148, 34, 0),
                new Vector3(145, 34, 0)), playerActor, 50));

            this.cameraManager.Add("FullScreen", pawnCamera);

            pawnCamera = new PawnCamera3D("RailCamera2",
                ObjectType.RailCamera, (Transform3D)Transform3D.Zero.Clone(),
                ProjectionParameters.StandardMediumFourThree, this.graphics.GraphicsDevice.Viewport);

            pawnCamera.Add(new RailCharacterFollowController("rail character follow controller 2",
                pawnCamera, true, new RailParameters("r2", new Vector3(0, 34, 60),
                new Vector3(0, 34, -120)), playerActor, 50));

            this.cameraManager.Add("FullScreen", pawnCamera);

            pawnCamera = new PawnCamera3D("RailCamera3",
                ObjectType.RailCamera, (Transform3D)Transform3D.Zero.Clone(),
                ProjectionParameters.StandardMediumFourThree, this.graphics.GraphicsDevice.Viewport);

            pawnCamera.Add(new RailCharacterFollowController("rail character follow controller 3",
                pawnCamera, true, new RailParameters("r3", new Vector3(0, 34, -60),
                new Vector3(0, 34, 120)), playerActor, 50));

            this.cameraManager.Add("FullScreen", pawnCamera);

            #endregion

            #region RotateCamera

            pawnCamera = new PawnCamera3D("RotateCamera",
                ObjectType.ZoomOnDoorCamera, new Transform3D(new Vector3(50,100,50), new Vector3(300, -300, 0), Vector3.UnitY),
                ProjectionParameters.StandardMediumFourThree, this.graphics.GraphicsDevice.Viewport);

            pawnCamera.Add(new RotatorController("rotate camera controller 1",
                pawnCamera, true, this.rotator));
            this.cameraManager.Add("FullScreen", pawnCamera);

            #endregion

            #region ZoomOnDoor

            pawnCamera = new PawnCamera3D("ZoomOnDoor",
                ObjectType.ZoomOnDoorCamera, new Transform3D(new Vector3(100, 126, 0), new Vector3(100,-51,0), Vector3.UnitY),
                ProjectionParameters.StandardMediumFourThree, this.graphics.GraphicsDevice.Viewport);
            pawnCamera.Add(new ShakeController("shaker1", pawnCamera, true));

            this.cameraManager.Add("FullScreen", pawnCamera);

            #endregion

            //set the default layout
            this.cameraManager.SetCameraLayout("FullScreen");
        }