Esempio n. 1
0
        public override ICameraController BeforeActive(ICameraController previous, World world)
        {
            if (previous is CameraController2D)
            {
                //convert to 3d then to fp
                var c3d = new CameraController3D(GD, world.State);
                c3d.InvalidateCamera(world.State);
                c3d.BeforeActive(previous, world);
                previous = c3d;

                /*
                 * base.SetActive(previous, world);
                 * previous = this;*/
            }
            return(previous);
        }
Esempio n. 2
0
 public virtual ICameraController BeforeActive(ICameraController previous, World world)
 {
     if (previous is CameraControllerFP)
     {
         //convert to 3d then to 2d.
         var c3d = new CameraController3D(GD, world.State);
         c3d.BeforeActive(previous, world);
         previous = c3d;
     }
     if (previous is CameraController3D)
     {
         //set rotation based on 3d camera
         var cam3d  = (CameraController3D)previous;
         var target = cam3d.Camera.Target / WorldSpace.WorldUnitsPerTile;
         SwitchCenter = world.State.Project2DCenterTile(new Vector3(target.X, target.Z, target.Y));
     }
     return(previous);
 }