Esempio n. 1
0
 private void btnFreeFlight_Click(object sender, EventArgs e)
 {
     if (!freeFlightActive)
     {
         LS.EvaluateLua(@"
             gvCamera.DefaultFlag = 0;
             Camera.ScrollUpdateZMode(3);
             Display.SetFarClipPlaneMinAndMax(1000000, 0);
             Camera.ZoomSetDistance(0);
             Game.GUIActivate(0);
             Camera.RotSetFlipBack(0);
             Camera.SetControlMode(1);
             Display.SetRenderSky(1);
         ");
         Camera       = S5CameraInfo.GetCurrentCamera();
         Camera.PosZ += 4000;
         Camera.WriteToMemory();
         tmrUpdateCamera.Start();
         joyStickCutsceneEditor.Enabled = true;
     }
     else
     {
         LS.EvaluateLua(@"
             Camera_InitParams();
             Game.GUIActivate(1);
             Camera.SetControlMode(0);
         ");
         tmrUpdateCamera.Stop();
         joyStickCutsceneEditor.Enabled = false;
     }
     freeFlightActive = !freeFlightActive;
 }
 public void updateCam()
 {
     cam.Point3D    = new Point3D((float)numX.Value, (float)numY.Value, (float)numZ.Value);
     cam.PitchAngle = (float)numPitch.Value;
     cam.YawAngle   = (float)numYaw.Value;
     cam.WriteToMemory();
     updateHeight();
 }
Esempio n. 3
0
        private void tmrUpdateCamera_Tick(object sender, EventArgs e)
        {
            if (joyStickCutsceneEditor.CurrentAction != JoyStick.Action.None)
            {
                float   yawRad   = (float)(Camera.YawAngle * Math.PI / 180);
                float   pitchRad = (float)(Camera.PitchAngle * Math.PI / 180);
                Point3D newPos   = Camera.Point3D;
                if (joyStickCutsceneEditor.CurrentAction > JoyStick.Action.None)
                {
                    Camera.YawAngle   += joyStickCutsceneEditor.Yaw * cameraControl;
                    Camera.PitchAngle += joyStickCutsceneEditor.Pitch * cameraControl;
                    newPos             = Camera.Point3D.MoveBy(pitchRad, yawRad, joyStickCutsceneEditor.Speed * speed);
                }
                else
                {
                    switch (joyStickCutsceneEditor.CurrentAction)
                    {
                    case JoyStick.Action.Leftward:
                        newPos = Camera.Point3D.MoveBy(0, (float)(yawRad + Math.PI / 2f), speed);
                        break;

                    case JoyStick.Action.Rightward:
                        newPos = Camera.Point3D.MoveBy(0, (float)(yawRad - Math.PI / 2f), speed);
                        break;

                    case JoyStick.Action.Upward:
                        newPos.Z += speed;
                        break;

                    case JoyStick.Action.Downward:
                        newPos.Z -= speed;
                        break;
                    }
                }
                Camera.Point3D = newPos;
                Camera.WriteToMemory();
                if (numCamContr.Visible)
                {
                    numCamContr.updateGUI();
                }
            }
        }