Ejemplo n.º 1
0
 private void CameraData_ValueChanged(object sender, EventArgs e)
 {
     if (!ProgramIsChangingStuff & CurrentlySelectedCamera != -1)
     {
         ShadowCamera current = ListBoxCameras.Items[CurrentlySelectedCamera] as ShadowCamera;
         current.CameraNumber                  = (int)numericUpDown_cameraNumber.Value;
         current.CameraMode                    = (ShadowCameraMode)comboBox_cameraMode.SelectedItem;
         current.field_08                      = (int)numericUpDown_i08.Value;
         current.field_0C                      = (int)numericUpDown_i0C.Value;
         current.field_10                      = (int)numericUpDown_i10.Value;
         current.field_14                      = (int)numericUpDown_i14.Value;
         current.LookBLinkId                   = (int)numericUpDown_LookBLinkId.Value;
         current.field_1C                      = (int)numericUpDown_i1C.Value;
         current.TriggerPosition               = new Vector3((float)numericUpDown_TriggerPosX.Value, (float)numericUpDownTriggerPosY.Value, (float)numericUpDownTriggerPosZ.Value);
         current.TriggerRotation               = new Vector3((float)((float)numericUpDown_TriggerRotX.Value / (180f / Math.PI)), (float)((float)numericUpDownTriggerRotY.Value / (180f / Math.PI)), (float)((float)numericUpDownTriggerRotZ.Value / (180f / Math.PI)));
         current.TriggerScale                  = new Vector3((float)numericUpDown_TriggerScaleX.Value, (float)numericUpDownTriggerScaleY.Value, (float)numericUpDownTriggerScaleZ.Value);
         current.PointA_LookFrom_X             = (float)numericUpDown_PointA_LookFrom_X.Value;
         current.PointA_LookFrom_Y             = (float)numericUpDown_PointA_LookFrom_Y.Value;
         current.PointA_LookFrom_Z             = (float)numericUpDown_PointA_LookFrom_Z.Value;
         current.PointA_LookAt_X               = (float)numericUpDown_PointA_LookAt_X.Value;
         current.PointA_LookAt_Y               = (float)numericUpDown_PointA_LookAt_Y.Value;
         current.PointA_LookAt_Z               = (float)numericUpDown_PointA_LookAt_Z.Value;
         current.CameraRotation                = (float)((float)numericUpDown_CameraRotation.Value / (180f / Math.PI));
         current.FOV_Height                    = (float)((float)numericUpDown_FOV_Height.Value / (180f / Math.PI));
         current.FOV_Width                     = (float)((float)numericUpDown_FOV_Width.Value / (180f / Math.PI));
         current.field_68                      = (float)numericUpDown_f68.Value;
         current.field_6C                      = (float)numericUpDown_f6C.Value;
         current.field_70                      = (float)numericUpDown_f70.Value;
         current.field_74                      = (float)numericUpDown_f74.Value;
         current.PointB_LookFrom_X             = (float)numericUpDown_PointB_LookFrom_X.Value;
         current.PointB_LookFrom_Y             = (float)numericUpDown_PointB_LookFrom_Y.Value;
         current.PointB_LookFrom_Z             = (float)numericUpDown_PointB_LookFrom_Z.Value;
         current.PointB_LookAt_X               = (float)numericUpDown_PointB_LookAt_X.Value;
         current.PointB_LookAt_Y               = (float)numericUpDown_PointB_LookAt_Y.Value;
         current.PointB_LookAt_Z               = (float)numericUpDown_PointB_LookAt_Z.Value;
         current.CameraDistanceFromPlayerLookA = (float)numericUpDown_CameraDistanceFromPlayerLookA.Value;
         current.CameraHeightFromPlayerLookA   = (float)numericUpDown_CameraHeightFromPlayerLookA.Value;
         current.CameraDistanceFromPlayerLookB = (float)numericUpDown_CameraDistanceFromPlayerLookB.Value;
         current.CameraHeightFromPlayerLookB   = (float)numericUpDown_CameraHeightFromPlayerLookB.Value;
         current.field_A0                      = (float)numericUpDown_fA0.Value;
         current.field_A4                      = (float)numericUpDown_fA4.Value;
         current.field_A8                      = (float)numericUpDown_fA8.Value;
         current.field_AC                      = (float)numericUpDown_fAC.Value;
         current.TransitionTimeEnter           = (float)numericUpDown_TransitionTimeEnter.Value;
         current.TransitionTimeExit            = (float)numericUpDown_TransitionTimeExit.Value;
         current.field_B8                      = (float)numericUpDown_fB8.Value;
         current.field_BC                      = (float)numericUpDown_fBC.Value;
         current.field_C0                      = (float)numericUpDown_fC0.Value;
         current.field_C4                      = (float)numericUpDown_fC4.Value;
         current.field_C8                      = (float)numericUpDown_fC8.Value;
         current.field_CC                      = (float)numericUpDown_fCC.Value;
         current.field_D0                      = (float)numericUpDown_fD0.Value;
         current.field_D4                      = (float)numericUpDown_fD4.Value;
         current.field_D8                      = (float)numericUpDown_fD8.Value;
         current.CreateTransformMatrix();
         ListBoxCameras.Items[CurrentlySelectedCamera] = current;
     }
 }
Ejemplo n.º 2
0
        private void buttonDuplicate_Click(object sender, EventArgs e)
        {
            ShadowCamera newCamera = new ShadowCamera((ShadowCamera)ListBoxCameras.Items[CurrentlySelectedCamera]);

            newCamera.CreateTransformMatrix();
            ListBoxCameras.Items.Add(newCamera);
            ListBoxCameras.SelectedIndex = ListBoxCameras.Items.Count - 1;
            UpdateLabelCameraCount();
        }
Ejemplo n.º 3
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            ShadowCamera newCamera = new ShadowCamera()
            {
                TriggerPosition = Program.MainForm.renderer.Camera.GetPosition()
            };

            newCamera.CreateTransformMatrix();
            ListBoxCameras.Items.Add(newCamera);
            ListBoxCameras.SelectedIndex = ListBoxCameras.Items.Count - 1;
            UpdateLabelCameraCount();
        }
Ejemplo n.º 4
0
        public static Tuple <ShadowCameraFileHeader, List <ShadowCamera> > ImportCameraFile(string fileName)
        {
            List <ShadowCamera>    list = new List <ShadowCamera>();
            ShadowCameraFileHeader header;

            using (BinaryReader camReader = new BinaryReader(new FileStream(fileName, FileMode.Open)))
            {
                camReader.BaseStream.Position = 0;
                header = new ShadowCameraFileHeader(
                    camReader.ReadInt32(), camReader.ReadInt32(), camReader.ReadInt32(),
                    camReader.ReadInt32(), camReader.ReadInt32(), camReader.ReadInt32()
                    );

                while (camReader.BaseStream.Position != camReader.BaseStream.Length)
                {
                    ShadowCamera TempCam = new ShadowCamera(
                        camReader.ReadInt32(), //i_00
                        camReader.ReadInt32(),
                        camReader.ReadInt32(),
                        camReader.ReadInt32(),
                        camReader.ReadInt32(),
                        camReader.ReadInt32(),
                        camReader.ReadInt32(),
                        camReader.ReadInt32(), //i_1C
                        new Vector3(camReader.ReadSingle(), camReader.ReadSingle(), camReader.ReadSingle()),
                        new Vector3(camReader.ReadSingle(), camReader.ReadSingle(), camReader.ReadSingle()),
                        new Vector3(camReader.ReadSingle(), camReader.ReadSingle(), camReader.ReadSingle()),
                        camReader.ReadSingle(), //i_44
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //i_58
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //60
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //70
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //80
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //90
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //A0
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //B0
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //C0
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(),
                        camReader.ReadSingle(), //D0
                        camReader.ReadSingle(),
                        camReader.ReadSingle()
                        );

                    //if (TempCam.CameraType == 0 & TempCam.CameraSpeed == 0 & TempCam.Integer3 == 0 & TempCam.ActivationType == 0 & TempCam.TriggerShape == 0)
                    //   continue;

                    TempCam.CreateTransformMatrix();

                    list.Add(TempCam);
                }
            }
            return(Tuple.Create(header, list));
        }