private void SetupForCam(AssetCAM asset)
        {
            AddRow();

            Button buttonGetPos = new Button()
            {
                Dock = DockStyle.Fill, Text = "Get View Position", AutoSize = true
            };

            buttonGetPos.Click += (object sender, EventArgs e) =>
            {
                asset.SetPosition(Program.MainForm.renderer.Camera.Position);

                propertyGridAsset.Refresh();
                archive.UnsavedChanges = true;
            };
            tableLayoutPanel1.Controls.Add(buttonGetPos);

            Button buttonGetDir = new Button()
            {
                Dock = DockStyle.Fill, Text = "Get View Direction", AutoSize = true
            };

            buttonGetDir.Click += (object sender, EventArgs e) =>
            {
                asset.SetNormalizedForward(Program.MainForm.renderer.Camera.Forward);
                asset.SetNormalizedUp(Program.MainForm.renderer.Camera.Up);
                asset.SetNormalizedLeft(Program.MainForm.renderer.Camera.Right);

                propertyGridAsset.Refresh();
                archive.UnsavedChanges = true;
            };
            tableLayoutPanel1.Controls.Add(buttonGetDir);
        }
Exemple #2
0
 private void buttonGetDir_Click(object sender, System.EventArgs e)
 {
     asset.SetNormalizedForward(Program.MainForm.renderer.Camera.Forward);
     asset.SetNormalizedUp(Program.MainForm.renderer.Camera.Up);
     asset.SetNormalizedLeft(Program.MainForm.renderer.Camera.Right);
 }