Exemplo n.º 1
0
 public Camera2 GetCamera()
 {
     Camera2 camera = new Camera2(new Scene(), new Transform2(), 1.3333f);
     camera.WorldTransform = PortalCommon.GetWorldTransform(camera);
     return camera;
 }
Exemplo n.º 2
0
        public void Init(Renderer renderer, Size canvasSize)
        {
            _renderer = renderer;

            Camera2 camera = new Camera2(
                Scene,
                new Transform2(new Vector2(), 10),
                canvasSize.Width / (float)canvasSize.Height);

            Scene.SetActiveCamera(camera);

            _tankCamera = new TankCamera(camera, null, _controller);

            Entity entity2 = new Entity(Scene);
            entity2.AddModel(ModelFactory.CreatePlane(new Vector2(10, 10)));
            entity2.ModelList[0].SetTexture(_renderer?.Textures["default.png"]);

            PortalCommon.UpdateWorldTransform(Scene);
            _renderer?.AddLayer(Scene);
        }
Exemplo n.º 3
0
 public TankCamera(Camera2 camera, Tank tank, IController controller)
 {
     Camera = camera;
     SetTank(tank);
     Controller = controller;
 }
Exemplo n.º 4
0
 public override IDeepClone ShallowClone()
 {
     Camera2 clone = new Camera2(Scene);
     ShallowClone(clone);
     return clone;
 }