예제 #1
0
 public CameraHeroes(CameraHeroes camera)
 {
     CameraType      = camera.CameraType;
     CameraSpeed     = camera.CameraSpeed;
     Integer3        = camera.Integer3;
     ActivationType  = camera.ActivationType;
     TriggerShape    = camera.TriggerShape;
     TriggerPosition = camera.TriggerPosition;
     TriggerRotX     = camera.TriggerRotX;
     TriggerRotY     = camera.TriggerRotY;
     TriggerRotZ     = camera.TriggerRotZ;
     TriggerScale    = camera.TriggerScale;
     CamPos          = camera.CamPos;
     CamRotX         = camera.CamRotX;
     CamRotY         = camera.CamRotY;
     CamRotZ         = camera.CamRotZ;
     PointA          = camera.PointA;
     PointB          = camera.PointB;
     PointC          = camera.PointC;
     Integer30       = camera.Integer30;
     Integer31       = camera.Integer31;
     FloatX32        = camera.FloatX32;
     FloatY33        = camera.FloatY33;
     FloatX34        = camera.FloatX34;
     FloatY35        = camera.FloatY35;
     Integer36       = camera.Integer36;
     Integer37       = camera.Integer37;
     Integer38       = camera.Integer38;
     Integer39       = camera.Integer39;
 }
예제 #2
0
        private void buttonCopy_Click(object sender, EventArgs e)
        {
            CameraHeroes newCamera = new CameraHeroes((CameraHeroes)ListBoxCameras.Items[CurrentlySelectedCamera]);

            newCamera.CreateTransformMatrix();
            ListBoxCameras.Items.Add(newCamera);
            ListBoxCameras.SelectedIndex = ListBoxCameras.Items.Count - 1;
            UpdateLabelCameraCount();
        }
예제 #3
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            CameraHeroes newCamera = new CameraHeroes()
            {
                TriggerPosition = SharpRenderer.Camera.GetPosition()
            };

            ListBoxCameras.Items.Add(newCamera);
            ListBoxCameras.SelectedIndex = ListBoxCameras.Items.Count - 1;
            UpdateLabelCameraCount();
        }
예제 #4
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            CameraHeroes newCamera = new CameraHeroes()
            {
                TriggerPosition = Program.MainForm.renderer.Camera.GetPosition()
            };

            newCamera.CreateTransformMatrix();
            ListBoxCameras.Items.Add(newCamera);
            ListBoxCameras.SelectedIndex = ListBoxCameras.Items.Count - 1;
            UpdateLabelCameraCount();
        }
        public static List <CameraHeroes> ImportCameraFile(string fileName)
        {
            BinaryReader        CameraReader = new BinaryReader(new FileStream(fileName, FileMode.Open));
            List <CameraHeroes> list         = new List <CameraHeroes>();

            CameraReader.BaseStream.Position = 0;

            while (CameraReader.BaseStream.Position != CameraReader.BaseStream.Length)
            {
                CameraHeroes TempCam = new CameraHeroes(
                    cameraType: Switch(CameraReader.ReadInt32()),
                    cameraSpeed: Switch(CameraReader.ReadInt32()),
                    integer3: Switch(CameraReader.ReadInt32()),
                    activationType: Switch(CameraReader.ReadInt32()),
                    triggerShape: Switch(CameraReader.ReadInt32()),
                    triggerPosition: new Vector3(Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle())),
                    triggerRotX: Switch(CameraReader.ReadInt32()),
                    triggerRotY: Switch(CameraReader.ReadInt32()),
                    triggerRotZ: Switch(CameraReader.ReadInt32()),
                    triggerScale: new Vector3(Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle())),
                    camPos: new Vector3(Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle())),
                    camRotX: Switch(CameraReader.ReadInt32()),
                    camRotY: Switch(CameraReader.ReadInt32()),
                    camRotZ: Switch(CameraReader.ReadInt32()),
                    pointA: new Vector3(Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle())),
                    pointB: new Vector3(Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle())),
                    pointC: new Vector3(Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle()), Switch(CameraReader.ReadSingle())),
                    integer30: Switch(CameraReader.ReadInt32()),
                    integer31: Switch(CameraReader.ReadInt32()),
                    floatX32: Switch(CameraReader.ReadSingle()),
                    floatY33: Switch(CameraReader.ReadSingle()),
                    floatX34: Switch(CameraReader.ReadSingle()),
                    floatY35: Switch(CameraReader.ReadSingle()),
                    integer36: Switch(CameraReader.ReadInt32()),
                    integer37: Switch(CameraReader.ReadInt32()),
                    integer38: Switch(CameraReader.ReadInt32()),
                    integer39: Switch(CameraReader.ReadInt32())
                    );

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

                TempCam.CreateTransformMatrix();

                list.Add(TempCam);
            }

            CameraReader.Close();
            return(list);
        }
예제 #6
0
        private void numericUpDown_ValueChanged(object sender, EventArgs e)
        {
            if (!ProgramIsChangingStuff & CurrentlySelectedCamera != -1)
            {
                CameraHeroes current = ListBoxCameras.Items[CurrentlySelectedCamera] as CameraHeroes;

                current.CameraType      = (int)numericUpDownCamType.Value;
                current.CameraSpeed     = (int)numericUpDownCamSpeed.Value;
                current.Integer3        = (int)numericUpDown3.Value;
                current.ActivationType  = (int)numericUpDownActType.Value;
                current.TriggerShape    = (int)numericUpDownTrigShape.Value;
                current.TriggerPosition = new Vector3((float)numericUpDownColPosX.Value, (float)numericUpDownColPosY.Value, (float)numericUpDownColPosZ.Value);
                current.TriggerRotX     = ReadWriteCommon.DegreesToBAMS((float)numericUpDownColRotX.Value);
                current.TriggerRotY     = ReadWriteCommon.DegreesToBAMS((float)numericUpDownColRotY.Value);
                current.TriggerRotZ     = ReadWriteCommon.DegreesToBAMS((float)numericUpDownColRotZ.Value);
                current.TriggerScale    = new Vector3((float)numericUpDownColSclX.Value, (float)numericUpDownColSclY.Value, (float)numericUpDownColSclZ.Value);
                current.CamPos          = new Vector3((float)numericUpDownCamPosX.Value, (float)numericUpDownCamPosY.Value, (float)numericUpDownCamPosZ.Value);
                current.CamRotX         = ReadWriteCommon.DegreesToBAMS((float)numericUpDownCamRotX.Value);
                current.CamRotY         = ReadWriteCommon.DegreesToBAMS((float)numericUpDownCamRotY.Value);
                current.CamRotZ         = ReadWriteCommon.DegreesToBAMS((float)numericUpDownCamRotZ.Value);
                current.PointA          = new Vector3((float)numericUpDown21.Value, (float)numericUpDown22.Value, (float)numericUpDown23.Value);
                current.PointB          = new Vector3((float)numericUpDown24.Value, (float)numericUpDown25.Value, (float)numericUpDown26.Value);
                current.PointC          = new Vector3((float)numericUpDown27.Value, (float)numericUpDown28.Value, (float)numericUpDown29.Value);
                current.Integer30       = (int)numericUpDown30.Value;
                current.Integer31       = (int)numericUpDown31.Value;
                current.FloatX32        = (float)numericUpDown32.Value;
                current.FloatY33        = (float)numericUpDown33.Value;
                current.FloatX34        = (float)numericUpDown34.Value;
                current.FloatY35        = (float)numericUpDown35.Value;
                current.Integer36       = (int)numericUpDown36.Value;
                current.Integer37       = (int)numericUpDown37.Value;
                current.Integer38       = (int)numericUpDown38.Value;
                current.Integer39       = (int)numericUpDown39.Value;
                current.CreateTransformMatrix();

                ListBoxCameras.Items[CurrentlySelectedCamera] = current;
            }
        }
예제 #7
0
        private void ListBoxCameras_SelectedIndexChanged(object sender, EventArgs e)
        {
            ProgramIsChangingStuff = true;

            if (!hasRemoved & CurrentlySelectedCamera != -1)
            {
                (ListBoxCameras.Items[CurrentlySelectedCamera] as CameraHeroes).isSelected = false;
            }
            else if (hasRemoved)
            {
                hasRemoved = false;
            }

            CurrentlySelectedCamera = ListBoxCameras.SelectedIndex;

            if (CurrentlySelectedCamera != -1)
            {
                try
                {
                    CameraHeroes current = ListBoxCameras.Items[CurrentlySelectedCamera] as CameraHeroes;

                    current.isSelected = true;

                    numericUpDownCamType.Value   = current.CameraType;
                    numericUpDownCamSpeed.Value  = current.CameraSpeed;
                    numericUpDown3.Value         = current.Integer3;
                    numericUpDownActType.Value   = current.ActivationType;
                    numericUpDownTrigShape.Value = current.TriggerShape;
                    numericUpDownColPosX.Value   = (decimal)current.TriggerPosition.X;
                    numericUpDownColPosY.Value   = (decimal)current.TriggerPosition.Y;
                    numericUpDownColPosZ.Value   = (decimal)current.TriggerPosition.Z;
                    numericUpDownColRotX.Value   = (decimal)(current.TriggerRotX * (360f / 65536f));
                    numericUpDownColRotY.Value   = (decimal)(current.TriggerRotY * (360f / 65536f));
                    numericUpDownColRotZ.Value   = (decimal)(current.TriggerRotZ * (360f / 65536f));
                    numericUpDownColSclX.Value   = (decimal)current.TriggerScale.X;
                    numericUpDownColSclY.Value   = (decimal)current.TriggerScale.Y;
                    numericUpDownColSclZ.Value   = (decimal)current.TriggerScale.Z;
                    numericUpDownCamPosX.Value   = (decimal)current.CamPos.X;
                    numericUpDownCamPosY.Value   = (decimal)current.CamPos.Y;
                    numericUpDownCamPosZ.Value   = (decimal)current.CamPos.Z;
                    numericUpDownCamRotX.Value   = (decimal)(current.CamRotX * (360f / 65536f));
                    numericUpDownCamRotY.Value   = (decimal)(current.CamRotY * (360f / 65536f));
                    numericUpDownCamRotZ.Value   = (decimal)(current.CamRotZ * (360f / 65536f));
                    numericUpDown21.Value        = (decimal)current.PointA.X;
                    numericUpDown22.Value        = (decimal)current.PointA.Y;
                    numericUpDown23.Value        = (decimal)current.PointA.Z;
                    numericUpDown24.Value        = (decimal)current.PointB.X;
                    numericUpDown25.Value        = (decimal)current.PointB.Y;
                    numericUpDown26.Value        = (decimal)current.PointB.Z;
                    numericUpDown27.Value        = (decimal)current.PointC.X;
                    numericUpDown28.Value        = (decimal)current.PointC.Y;
                    numericUpDown29.Value        = (decimal)current.PointC.Z;
                    numericUpDown30.Value        = current.Integer30;
                    numericUpDown31.Value        = current.Integer31;
                    numericUpDown32.Value        = (decimal)current.FloatX32;
                    numericUpDown33.Value        = (decimal)current.FloatY33;
                    numericUpDown34.Value        = (decimal)current.FloatX34;
                    numericUpDown35.Value        = (decimal)current.FloatY35;
                    numericUpDown36.Value        = current.Integer36;
                    numericUpDown37.Value        = current.Integer37;
                    numericUpDown38.Value        = current.Integer38;
                    numericUpDown39.Value        = current.Integer39;
                }
                catch
                {
                    MessageBox.Show("Could not load this camera properly: one or more properties are unsupported.");
                }
            }

            UpdateLabelCameraCount();
            ProgramIsChangingStuff = false;
        }