Exemplo n.º 1
0
        private async Task Freecam_UpdateCamera()
        {
            //Check if the camera is valid.
            if (!camera.IsValid)
            {
                await Task.FromResult(0);

                return;
            }

            camera.Update();
            Focus.Set(camera.Position, camera.Rotation);
        }
Exemplo n.º 2
0
        public void Update()
        {
            //Check if the camera is valid.
            if (!camera.IsValid)
            {
                return;
            }

            int   time  = -1;
            Input input = MapBuilderClient.Locator.GetService <Input>();

            if (input.PollKey(0, 32, out time))
            {
                camera.TranslateX(time, false);
            }
            if (input.PollKey(0, 33, out time))
            {
                camera.TranslateX(time, true);
            }
            if (input.PollKey(0, 34, out time))
            {
                camera.TranslateZ(time, false);
            }
            if (input.PollKey(0, 35, out time))
            {
                camera.TranslateZ(time, true);
            }
            if (input.PollKey(0, 52, out time))
            {
                camera.TranslateY(time, false);
            }
            if (input.PollKey(0, 54, out time))
            {
                camera.TranslateY(time, true);
            }

            camera.Rotate(input.PollMouse());

            camera.Update();

            Focus.Set(
                camera.NativeCamera.Position,
                camera.NativeCamera.Rotation
                );
        }
Exemplo n.º 3
0
 public void EnableFreecam()
 {
     camera.Create();
     PlayerHelper.HidePlayer();
     Focus.Set(camera.Position, camera.Rotation);
 }