Collisions editing progress

This commit is contained in:
dexy 2020-01-13 23:31:27 +11:00
parent 741cf0ecfc
commit 3f24a234e6
11 changed files with 1116 additions and 711 deletions

View File

@ -1131,6 +1131,7 @@ namespace CodeWalker.GameFiles
BuildMaterials(); BuildMaterials();
CalculateQuantum(); CalculateQuantum();
UpdateEdgeIndices(); UpdateEdgeIndices();
UpdateTriangleAreas();
var list = new List<IResourceBlock>(base.GetReferences()); var list = new List<IResourceBlock>(base.GetReferences());
if (Vertices2 != null) if (Vertices2 != null)
@ -1655,6 +1656,29 @@ namespace CodeWalker.GameFiles
} }
public void UpdateTriangleAreas()
{
//update all triangle areas, based on vertex positions
if (Polygons == null)
{ return; }
var edgedict = new Dictionary<BoundEdgeRef, BoundEdge>();
foreach (var poly in Polygons)
{
if (poly is BoundPolygonTriangle btri)
{
var v1 = btri.Vertex1;
var v2 = btri.Vertex2;
var v3 = btri.Vertex3;
var area = TriangleMath.Area(ref v1, ref v2, ref v3);
//if (Math.Abs(btri.triArea - area) > Math.Max(area*0.1f,0.1f))
//{ }//ehh good enough
btri.triArea = area;
}
}
}
public bool DeletePolygon(BoundPolygon p) public bool DeletePolygon(BoundPolygon p)
{ {
@ -2261,6 +2285,9 @@ namespace CodeWalker.GameFiles
child.TransformInv = Matrix.Invert(xform); child.TransformInv = Matrix.Invert(xform);
child.CompositeFlags1 = ((ChildrenFlags1 != null) && (i < ChildrenFlags1.Length)) ? ChildrenFlags1[i] : new BoundCompositeChildrenFlags(); child.CompositeFlags1 = ((ChildrenFlags1 != null) && (i < ChildrenFlags1.Length)) ? ChildrenFlags1[i] : new BoundCompositeChildrenFlags();
child.CompositeFlags2 = ((ChildrenFlags2 != null) && (i < ChildrenFlags2.Length)) ? ChildrenFlags2[i] : new BoundCompositeChildrenFlags(); child.CompositeFlags2 = ((ChildrenFlags2 != null) && (i < ChildrenFlags2.Length)) ? ChildrenFlags2[i] : new BoundCompositeChildrenFlags();
//if ((child.CompositeFlags1.Flags1 != child.CompositeFlags2.Flags1) || (child.CompositeFlags1.Flags2 != child.CompositeFlags2.Flags2))
//{ } //no hits
} }
} }
} }

View File

@ -309,6 +309,63 @@ namespace CodeWalker
return Vector3.Normalize(Vector3.Cross(Vector3.Cross(ab, av), ab)); return Vector3.Normalize(Vector3.Cross(Vector3.Cross(ab, av), ab));
} }
public static float PointRayDist(ref Vector3 p, ref Vector3 ro, ref Vector3 rd)
{
return Vector3.Cross(rd, p - ro).Length();
}
}
public static class TriangleMath
{
public static float AreaPart(ref Vector3 v1, ref Vector3 v2, ref Vector3 v3, out float angle)
{
var va = v2 - v1;
var vb = v3 - v1;
var na = Vector3.Normalize(va);
var nb = Vector3.Normalize(vb);
var a = va.Length();
var b = vb.Length();
var c = Math.Acos(Vector3.Dot(na, nb));
var area = (float)(0.5 * a * b * Math.Sin(c));
angle = (float)Math.Abs(c);
return area;
}
public static float Area(ref Vector3 v1, ref Vector3 v2, ref Vector3 v3)
{
var a1 = AreaPart(ref v1, ref v2, ref v3, out float t1);
var a2 = AreaPart(ref v2, ref v3, ref v1, out float t2);
var a3 = AreaPart(ref v3, ref v1, ref v2, out float t3);
var fp = (float)Math.PI;
var d1 = Math.Min(t1, Math.Abs(t1 - fp));
var d2 = Math.Min(t2, Math.Abs(t2 - fp));
var d3 = Math.Min(t3, Math.Abs(t3 - fp));
if ((d1 >= d2) && (a1 != 0))
{
if ((d1 >= d3) || (a3 == 0))
{
return a1;
}
else
{
return a3;
}
}
else
{
if ((d2 >= d3) || (a3 == 0))
{
return a2;
}
else
{
return a3;
}
}
}
} }

View File

@ -31,45 +31,28 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditYbnBoundPolyPanel)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditYbnBoundPolyPanel));
this.PolyTabControl = new System.Windows.Forms.TabControl(); this.PolyTabControl = new System.Windows.Forms.TabControl();
this.TriangleTabPage = new System.Windows.Forms.TabPage(); this.TriangleTabPage = new System.Windows.Forms.TabPage();
this.SphereTabPage = new System.Windows.Forms.TabPage(); this.TriFlag3CheckBox = new System.Windows.Forms.CheckBox();
this.CapsuleTabPage = new System.Windows.Forms.TabPage(); this.TriFlag2CheckBox = new System.Windows.Forms.CheckBox();
this.BoxTabPage = new System.Windows.Forms.TabPage(); this.TriFlag1CheckBox = new System.Windows.Forms.CheckBox();
this.CylinderTabPage = new System.Windows.Forms.TabPage();
this.TriVertex3TextBox = new System.Windows.Forms.TextBox(); this.TriVertex3TextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.TriVertex2TextBox = new System.Windows.Forms.TextBox(); this.TriVertex2TextBox = new System.Windows.Forms.TextBox();
this.TriVertex1TextBox = new System.Windows.Forms.TextBox(); this.TriVertex1TextBox = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.TriAreaTextBox = new System.Windows.Forms.TextBox(); this.SphereTabPage = new System.Windows.Forms.TabPage();
this.label2 = new System.Windows.Forms.Label();
this.TriEdge1UpDown = new System.Windows.Forms.NumericUpDown();
this.label7 = new System.Windows.Forms.Label();
this.TriEdge2UpDown = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label();
this.TriEdge3UpDown = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.TriFlag1CheckBox = new System.Windows.Forms.CheckBox();
this.TriFlag2CheckBox = new System.Windows.Forms.CheckBox();
this.TriFlag3CheckBox = new System.Windows.Forms.CheckBox();
this.MaterialTabControl = new System.Windows.Forms.TabControl();
this.MaterialTabPage = new System.Windows.Forms.TabPage();
this.SphRadiusTextBox = new System.Windows.Forms.TextBox(); this.SphRadiusTextBox = new System.Windows.Forms.TextBox();
this.SphPositionTextBox = new System.Windows.Forms.TextBox(); this.SphPositionTextBox = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label();
this.CapsuleTabPage = new System.Windows.Forms.TabPage();
this.CapRadiusTextBox = new System.Windows.Forms.TextBox(); this.CapRadiusTextBox = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
this.CapVertex2TextBox = new System.Windows.Forms.TextBox(); this.CapVertex2TextBox = new System.Windows.Forms.TextBox();
this.CapVertex1TextBox = new System.Windows.Forms.TextBox(); this.CapVertex1TextBox = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label();
this.CylRadiusTextBox = new System.Windows.Forms.TextBox(); this.BoxTabPage = new System.Windows.Forms.TabPage();
this.label13 = new System.Windows.Forms.Label();
this.CylVertex2TextBox = new System.Windows.Forms.TextBox();
this.CylVertex1TextBox = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.BoxVertex4TextBox = new System.Windows.Forms.TextBox(); this.BoxVertex4TextBox = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label();
this.BoxVertex3TextBox = new System.Windows.Forms.TextBox(); this.BoxVertex3TextBox = new System.Windows.Forms.TextBox();
@ -78,8 +61,19 @@
this.BoxVertex1TextBox = new System.Windows.Forms.TextBox(); this.BoxVertex1TextBox = new System.Windows.Forms.TextBox();
this.label18 = new System.Windows.Forms.Label(); this.label18 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label(); this.label19 = new System.Windows.Forms.Label();
this.MatTypeCombo = new System.Windows.Forms.ComboBox(); this.CylinderTabPage = new System.Windows.Forms.TabPage();
this.label20 = new System.Windows.Forms.Label(); this.CylRadiusTextBox = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.CylVertex2TextBox = new System.Windows.Forms.TextBox();
this.CylVertex1TextBox = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.MaterialTabControl = new System.Windows.Forms.TabControl();
this.MaterialTabPage = new System.Windows.Forms.TabPage();
this.UpdateSharedMaterialCheckBox = new System.Windows.Forms.CheckBox();
this.MatFlagsCheckedListBox = new System.Windows.Forms.CheckedListBox();
this.MatColourUpDown = new System.Windows.Forms.NumericUpDown();
this.label25 = new System.Windows.Forms.Label();
this.MatUnkUpDown = new System.Windows.Forms.NumericUpDown(); this.MatUnkUpDown = new System.Windows.Forms.NumericUpDown();
this.label21 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label();
this.MatPedDensityUpDown = new System.Windows.Forms.NumericUpDown(); this.MatPedDensityUpDown = new System.Windows.Forms.NumericUpDown();
@ -88,10 +82,8 @@
this.label23 = new System.Windows.Forms.Label(); this.label23 = new System.Windows.Forms.Label();
this.MatProceduralIDUpDown = new System.Windows.Forms.NumericUpDown(); this.MatProceduralIDUpDown = new System.Windows.Forms.NumericUpDown();
this.label24 = new System.Windows.Forms.Label(); this.label24 = new System.Windows.Forms.Label();
this.MatColourUpDown = new System.Windows.Forms.NumericUpDown(); this.MatTypeCombo = new System.Windows.Forms.ComboBox();
this.label25 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label();
this.MatFlagsCheckedListBox = new System.Windows.Forms.CheckedListBox();
this.UpdateSharedMaterialCheckBox = new System.Windows.Forms.CheckBox();
this.DeleteButton = new System.Windows.Forms.Button(); this.DeleteButton = new System.Windows.Forms.Button();
this.AddToProjectButton = new System.Windows.Forms.Button(); this.AddToProjectButton = new System.Windows.Forms.Button();
this.PolyTabControl.SuspendLayout(); this.PolyTabControl.SuspendLayout();
@ -100,16 +92,13 @@
this.CapsuleTabPage.SuspendLayout(); this.CapsuleTabPage.SuspendLayout();
this.BoxTabPage.SuspendLayout(); this.BoxTabPage.SuspendLayout();
this.CylinderTabPage.SuspendLayout(); this.CylinderTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.TriEdge1UpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.TriEdge2UpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.TriEdge3UpDown)).BeginInit();
this.MaterialTabControl.SuspendLayout(); this.MaterialTabControl.SuspendLayout();
this.MaterialTabPage.SuspendLayout(); this.MaterialTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.MatColourUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MatUnkUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.MatUnkUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MatPedDensityUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.MatPedDensityUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MatRoomIDUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.MatRoomIDUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MatProceduralIDUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.MatProceduralIDUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.MatColourUpDown)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// PolyTabControl // PolyTabControl
@ -124,7 +113,7 @@
this.PolyTabControl.Location = new System.Drawing.Point(0, 12); this.PolyTabControl.Location = new System.Drawing.Point(0, 12);
this.PolyTabControl.Name = "PolyTabControl"; this.PolyTabControl.Name = "PolyTabControl";
this.PolyTabControl.SelectedIndex = 0; this.PolyTabControl.SelectedIndex = 0;
this.PolyTabControl.Size = new System.Drawing.Size(564, 213); this.PolyTabControl.Size = new System.Drawing.Size(564, 137);
this.PolyTabControl.TabIndex = 0; this.PolyTabControl.TabIndex = 0;
// //
// TriangleTabPage // TriangleTabPage
@ -132,14 +121,6 @@
this.TriangleTabPage.Controls.Add(this.TriFlag3CheckBox); this.TriangleTabPage.Controls.Add(this.TriFlag3CheckBox);
this.TriangleTabPage.Controls.Add(this.TriFlag2CheckBox); this.TriangleTabPage.Controls.Add(this.TriFlag2CheckBox);
this.TriangleTabPage.Controls.Add(this.TriFlag1CheckBox); this.TriangleTabPage.Controls.Add(this.TriFlag1CheckBox);
this.TriangleTabPage.Controls.Add(this.TriEdge3UpDown);
this.TriangleTabPage.Controls.Add(this.label4);
this.TriangleTabPage.Controls.Add(this.TriEdge2UpDown);
this.TriangleTabPage.Controls.Add(this.label3);
this.TriangleTabPage.Controls.Add(this.TriEdge1UpDown);
this.TriangleTabPage.Controls.Add(this.label7);
this.TriangleTabPage.Controls.Add(this.TriAreaTextBox);
this.TriangleTabPage.Controls.Add(this.label2);
this.TriangleTabPage.Controls.Add(this.TriVertex3TextBox); this.TriangleTabPage.Controls.Add(this.TriVertex3TextBox);
this.TriangleTabPage.Controls.Add(this.label1); this.TriangleTabPage.Controls.Add(this.label1);
this.TriangleTabPage.Controls.Add(this.TriVertex2TextBox); this.TriangleTabPage.Controls.Add(this.TriVertex2TextBox);
@ -149,71 +130,43 @@
this.TriangleTabPage.Location = new System.Drawing.Point(4, 22); this.TriangleTabPage.Location = new System.Drawing.Point(4, 22);
this.TriangleTabPage.Name = "TriangleTabPage"; this.TriangleTabPage.Name = "TriangleTabPage";
this.TriangleTabPage.Padding = new System.Windows.Forms.Padding(3); this.TriangleTabPage.Padding = new System.Windows.Forms.Padding(3);
this.TriangleTabPage.Size = new System.Drawing.Size(556, 187); this.TriangleTabPage.Size = new System.Drawing.Size(556, 111);
this.TriangleTabPage.TabIndex = 0; this.TriangleTabPage.TabIndex = 0;
this.TriangleTabPage.Text = "Triangle"; this.TriangleTabPage.Text = "Triangle";
this.TriangleTabPage.UseVisualStyleBackColor = true; this.TriangleTabPage.UseVisualStyleBackColor = true;
// //
// SphereTabPage // TriFlag3CheckBox
// //
this.SphereTabPage.Controls.Add(this.SphRadiusTextBox); this.TriFlag3CheckBox.AutoSize = true;
this.SphereTabPage.Controls.Add(this.SphPositionTextBox); this.TriFlag3CheckBox.Location = new System.Drawing.Point(223, 84);
this.SphereTabPage.Controls.Add(this.label6); this.TriFlag3CheckBox.Name = "TriFlag3CheckBox";
this.SphereTabPage.Controls.Add(this.label8); this.TriFlag3CheckBox.Size = new System.Drawing.Size(55, 17);
this.SphereTabPage.Location = new System.Drawing.Point(4, 22); this.TriFlag3CheckBox.TabIndex = 23;
this.SphereTabPage.Name = "SphereTabPage"; this.TriFlag3CheckBox.Text = "Flag 3";
this.SphereTabPage.Padding = new System.Windows.Forms.Padding(3); this.TriFlag3CheckBox.UseVisualStyleBackColor = true;
this.SphereTabPage.Size = new System.Drawing.Size(556, 185); this.TriFlag3CheckBox.CheckedChanged += new System.EventHandler(this.TriFlag3CheckBox_CheckedChanged);
this.SphereTabPage.TabIndex = 1;
this.SphereTabPage.Text = "Sphere";
this.SphereTabPage.UseVisualStyleBackColor = true;
// //
// CapsuleTabPage // TriFlag2CheckBox
// //
this.CapsuleTabPage.Controls.Add(this.CapRadiusTextBox); this.TriFlag2CheckBox.AutoSize = true;
this.CapsuleTabPage.Controls.Add(this.label9); this.TriFlag2CheckBox.Location = new System.Drawing.Point(162, 84);
this.CapsuleTabPage.Controls.Add(this.CapVertex2TextBox); this.TriFlag2CheckBox.Name = "TriFlag2CheckBox";
this.CapsuleTabPage.Controls.Add(this.CapVertex1TextBox); this.TriFlag2CheckBox.Size = new System.Drawing.Size(55, 17);
this.CapsuleTabPage.Controls.Add(this.label10); this.TriFlag2CheckBox.TabIndex = 22;
this.CapsuleTabPage.Controls.Add(this.label12); this.TriFlag2CheckBox.Text = "Flag 2";
this.CapsuleTabPage.Location = new System.Drawing.Point(4, 22); this.TriFlag2CheckBox.UseVisualStyleBackColor = true;
this.CapsuleTabPage.Name = "CapsuleTabPage"; this.TriFlag2CheckBox.CheckedChanged += new System.EventHandler(this.TriFlag2CheckBox_CheckedChanged);
this.CapsuleTabPage.Size = new System.Drawing.Size(556, 185);
this.CapsuleTabPage.TabIndex = 2;
this.CapsuleTabPage.Text = "Capsule";
this.CapsuleTabPage.UseVisualStyleBackColor = true;
// //
// BoxTabPage // TriFlag1CheckBox
// //
this.BoxTabPage.Controls.Add(this.BoxVertex4TextBox); this.TriFlag1CheckBox.AutoSize = true;
this.BoxTabPage.Controls.Add(this.label16); this.TriFlag1CheckBox.Location = new System.Drawing.Point(101, 84);
this.BoxTabPage.Controls.Add(this.BoxVertex3TextBox); this.TriFlag1CheckBox.Name = "TriFlag1CheckBox";
this.BoxTabPage.Controls.Add(this.label17); this.TriFlag1CheckBox.Size = new System.Drawing.Size(55, 17);
this.BoxTabPage.Controls.Add(this.BoxVertex2TextBox); this.TriFlag1CheckBox.TabIndex = 21;
this.BoxTabPage.Controls.Add(this.BoxVertex1TextBox); this.TriFlag1CheckBox.Text = "Flag 1";
this.BoxTabPage.Controls.Add(this.label18); this.TriFlag1CheckBox.UseVisualStyleBackColor = true;
this.BoxTabPage.Controls.Add(this.label19); this.TriFlag1CheckBox.CheckedChanged += new System.EventHandler(this.TriFlag1CheckBox_CheckedChanged);
this.BoxTabPage.Location = new System.Drawing.Point(4, 22);
this.BoxTabPage.Name = "BoxTabPage";
this.BoxTabPage.Size = new System.Drawing.Size(556, 185);
this.BoxTabPage.TabIndex = 3;
this.BoxTabPage.Text = "Box";
this.BoxTabPage.UseVisualStyleBackColor = true;
//
// CylinderTabPage
//
this.CylinderTabPage.Controls.Add(this.CylRadiusTextBox);
this.CylinderTabPage.Controls.Add(this.label13);
this.CylinderTabPage.Controls.Add(this.CylVertex2TextBox);
this.CylinderTabPage.Controls.Add(this.CylVertex1TextBox);
this.CylinderTabPage.Controls.Add(this.label14);
this.CylinderTabPage.Controls.Add(this.label15);
this.CylinderTabPage.Location = new System.Drawing.Point(4, 22);
this.CylinderTabPage.Name = "CylinderTabPage";
this.CylinderTabPage.Size = new System.Drawing.Size(556, 185);
this.CylinderTabPage.TabIndex = 4;
this.CylinderTabPage.Text = "Cylinder";
this.CylinderTabPage.UseVisualStyleBackColor = true;
// //
// TriVertex3TextBox // TriVertex3TextBox
// //
@ -272,174 +225,19 @@
this.label5.TabIndex = 7; this.label5.TabIndex = 7;
this.label5.Text = "Vertex 1:"; this.label5.Text = "Vertex 1:";
// //
// TriAreaTextBox // SphereTabPage
// //
this.TriAreaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.SphereTabPage.Controls.Add(this.SphRadiusTextBox);
| System.Windows.Forms.AnchorStyles.Right))); this.SphereTabPage.Controls.Add(this.SphPositionTextBox);
this.TriAreaTextBox.Location = new System.Drawing.Point(92, 84); this.SphereTabPage.Controls.Add(this.label6);
this.TriAreaTextBox.Name = "TriAreaTextBox"; this.SphereTabPage.Controls.Add(this.label8);
this.TriAreaTextBox.Size = new System.Drawing.Size(457, 20); this.SphereTabPage.Location = new System.Drawing.Point(4, 22);
this.TriAreaTextBox.TabIndex = 14; this.SphereTabPage.Name = "SphereTabPage";
this.TriAreaTextBox.TextChanged += new System.EventHandler(this.TriAreaTextBox_TextChanged); this.SphereTabPage.Padding = new System.Windows.Forms.Padding(3);
// this.SphereTabPage.Size = new System.Drawing.Size(556, 128);
// label2 this.SphereTabPage.TabIndex = 1;
// this.SphereTabPage.Text = "Sphere";
this.label2.AutoSize = true; this.SphereTabPage.UseVisualStyleBackColor = true;
this.label2.Location = new System.Drawing.Point(54, 87);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 13);
this.label2.TabIndex = 13;
this.label2.Text = "Area:";
//
// TriEdge1UpDown
//
this.TriEdge1UpDown.Location = new System.Drawing.Point(92, 110);
this.TriEdge1UpDown.Maximum = new decimal(new int[] {
32767,
0,
0,
0});
this.TriEdge1UpDown.Minimum = new decimal(new int[] {
32767,
0,
0,
-2147483648});
this.TriEdge1UpDown.Name = "TriEdge1UpDown";
this.TriEdge1UpDown.Size = new System.Drawing.Size(89, 20);
this.TriEdge1UpDown.TabIndex = 16;
this.TriEdge1UpDown.ValueChanged += new System.EventHandler(this.TriEdge1UpDown_ValueChanged);
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(42, 112);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(44, 13);
this.label7.TabIndex = 15;
this.label7.Text = "Edge 1:";
//
// TriEdge2UpDown
//
this.TriEdge2UpDown.Location = new System.Drawing.Point(92, 136);
this.TriEdge2UpDown.Maximum = new decimal(new int[] {
32767,
0,
0,
0});
this.TriEdge2UpDown.Minimum = new decimal(new int[] {
32767,
0,
0,
-2147483648});
this.TriEdge2UpDown.Name = "TriEdge2UpDown";
this.TriEdge2UpDown.Size = new System.Drawing.Size(89, 20);
this.TriEdge2UpDown.TabIndex = 18;
this.TriEdge2UpDown.ValueChanged += new System.EventHandler(this.TriEdge2UpDown_ValueChanged);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(42, 138);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 13);
this.label3.TabIndex = 17;
this.label3.Text = "Edge 2:";
//
// TriEdge3UpDown
//
this.TriEdge3UpDown.Location = new System.Drawing.Point(92, 162);
this.TriEdge3UpDown.Maximum = new decimal(new int[] {
32767,
0,
0,
0});
this.TriEdge3UpDown.Minimum = new decimal(new int[] {
32767,
0,
0,
-2147483648});
this.TriEdge3UpDown.Name = "TriEdge3UpDown";
this.TriEdge3UpDown.Size = new System.Drawing.Size(89, 20);
this.TriEdge3UpDown.TabIndex = 20;
this.TriEdge3UpDown.ValueChanged += new System.EventHandler(this.TriEdge3UpDown_ValueChanged);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(42, 164);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 13);
this.label4.TabIndex = 19;
this.label4.Text = "Edge 3:";
//
// TriFlag1CheckBox
//
this.TriFlag1CheckBox.AutoSize = true;
this.TriFlag1CheckBox.Location = new System.Drawing.Point(224, 111);
this.TriFlag1CheckBox.Name = "TriFlag1CheckBox";
this.TriFlag1CheckBox.Size = new System.Drawing.Size(55, 17);
this.TriFlag1CheckBox.TabIndex = 21;
this.TriFlag1CheckBox.Text = "Flag 1";
this.TriFlag1CheckBox.UseVisualStyleBackColor = true;
this.TriFlag1CheckBox.CheckedChanged += new System.EventHandler(this.TriFlag1CheckBox_CheckedChanged);
//
// TriFlag2CheckBox
//
this.TriFlag2CheckBox.AutoSize = true;
this.TriFlag2CheckBox.Location = new System.Drawing.Point(224, 137);
this.TriFlag2CheckBox.Name = "TriFlag2CheckBox";
this.TriFlag2CheckBox.Size = new System.Drawing.Size(55, 17);
this.TriFlag2CheckBox.TabIndex = 22;
this.TriFlag2CheckBox.Text = "Flag 2";
this.TriFlag2CheckBox.UseVisualStyleBackColor = true;
this.TriFlag2CheckBox.CheckedChanged += new System.EventHandler(this.TriFlag2CheckBox_CheckedChanged);
//
// TriFlag3CheckBox
//
this.TriFlag3CheckBox.AutoSize = true;
this.TriFlag3CheckBox.Location = new System.Drawing.Point(224, 163);
this.TriFlag3CheckBox.Name = "TriFlag3CheckBox";
this.TriFlag3CheckBox.Size = new System.Drawing.Size(55, 17);
this.TriFlag3CheckBox.TabIndex = 23;
this.TriFlag3CheckBox.Text = "Flag 3";
this.TriFlag3CheckBox.UseVisualStyleBackColor = true;
this.TriFlag3CheckBox.CheckedChanged += new System.EventHandler(this.TriFlag3CheckBox_CheckedChanged);
//
// MaterialTabControl
//
this.MaterialTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.MaterialTabControl.Controls.Add(this.MaterialTabPage);
this.MaterialTabControl.Location = new System.Drawing.Point(0, 225);
this.MaterialTabControl.Name = "MaterialTabControl";
this.MaterialTabControl.SelectedIndex = 0;
this.MaterialTabControl.Size = new System.Drawing.Size(564, 279);
this.MaterialTabControl.TabIndex = 1;
//
// MaterialTabPage
//
this.MaterialTabPage.Controls.Add(this.UpdateSharedMaterialCheckBox);
this.MaterialTabPage.Controls.Add(this.MatFlagsCheckedListBox);
this.MaterialTabPage.Controls.Add(this.MatColourUpDown);
this.MaterialTabPage.Controls.Add(this.label25);
this.MaterialTabPage.Controls.Add(this.MatUnkUpDown);
this.MaterialTabPage.Controls.Add(this.label21);
this.MaterialTabPage.Controls.Add(this.MatPedDensityUpDown);
this.MaterialTabPage.Controls.Add(this.label22);
this.MaterialTabPage.Controls.Add(this.MatRoomIDUpDown);
this.MaterialTabPage.Controls.Add(this.label23);
this.MaterialTabPage.Controls.Add(this.MatProceduralIDUpDown);
this.MaterialTabPage.Controls.Add(this.label24);
this.MaterialTabPage.Controls.Add(this.MatTypeCombo);
this.MaterialTabPage.Controls.Add(this.label20);
this.MaterialTabPage.Location = new System.Drawing.Point(4, 22);
this.MaterialTabPage.Name = "MaterialTabPage";
this.MaterialTabPage.Padding = new System.Windows.Forms.Padding(3);
this.MaterialTabPage.Size = new System.Drawing.Size(556, 253);
this.MaterialTabPage.TabIndex = 0;
this.MaterialTabPage.Text = "Material";
this.MaterialTabPage.UseVisualStyleBackColor = true;
// //
// SphRadiusTextBox // SphRadiusTextBox
// //
@ -479,6 +277,21 @@
this.label8.TabIndex = 11; this.label8.TabIndex = 11;
this.label8.Text = "Position:"; this.label8.Text = "Position:";
// //
// CapsuleTabPage
//
this.CapsuleTabPage.Controls.Add(this.CapRadiusTextBox);
this.CapsuleTabPage.Controls.Add(this.label9);
this.CapsuleTabPage.Controls.Add(this.CapVertex2TextBox);
this.CapsuleTabPage.Controls.Add(this.CapVertex1TextBox);
this.CapsuleTabPage.Controls.Add(this.label10);
this.CapsuleTabPage.Controls.Add(this.label12);
this.CapsuleTabPage.Location = new System.Drawing.Point(4, 22);
this.CapsuleTabPage.Name = "CapsuleTabPage";
this.CapsuleTabPage.Size = new System.Drawing.Size(556, 128);
this.CapsuleTabPage.TabIndex = 2;
this.CapsuleTabPage.Text = "Capsule";
this.CapsuleTabPage.UseVisualStyleBackColor = true;
//
// CapRadiusTextBox // CapRadiusTextBox
// //
this.CapRadiusTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.CapRadiusTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -536,62 +349,22 @@
this.label12.TabIndex = 13; this.label12.TabIndex = 13;
this.label12.Text = "Vertex 1:"; this.label12.Text = "Vertex 1:";
// //
// CylRadiusTextBox // BoxTabPage
// //
this.CylRadiusTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.BoxTabPage.Controls.Add(this.BoxVertex4TextBox);
| System.Windows.Forms.AnchorStyles.Right))); this.BoxTabPage.Controls.Add(this.label16);
this.CylRadiusTextBox.Location = new System.Drawing.Point(92, 58); this.BoxTabPage.Controls.Add(this.BoxVertex3TextBox);
this.CylRadiusTextBox.Name = "CylRadiusTextBox"; this.BoxTabPage.Controls.Add(this.label17);
this.CylRadiusTextBox.Size = new System.Drawing.Size(457, 20); this.BoxTabPage.Controls.Add(this.BoxVertex2TextBox);
this.CylRadiusTextBox.TabIndex = 24; this.BoxTabPage.Controls.Add(this.BoxVertex1TextBox);
this.CylRadiusTextBox.TextChanged += new System.EventHandler(this.CylRadiusTextBox_TextChanged); this.BoxTabPage.Controls.Add(this.label18);
// this.BoxTabPage.Controls.Add(this.label19);
// label13 this.BoxTabPage.Location = new System.Drawing.Point(4, 22);
// this.BoxTabPage.Name = "BoxTabPage";
this.label13.AutoSize = true; this.BoxTabPage.Size = new System.Drawing.Size(556, 111);
this.label13.Location = new System.Drawing.Point(37, 61); this.BoxTabPage.TabIndex = 3;
this.label13.Name = "label13"; this.BoxTabPage.Text = "Box";
this.label13.Size = new System.Drawing.Size(43, 13); this.BoxTabPage.UseVisualStyleBackColor = true;
this.label13.TabIndex = 23;
this.label13.Text = "Radius:";
//
// CylVertex2TextBox
//
this.CylVertex2TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CylVertex2TextBox.Location = new System.Drawing.Point(92, 32);
this.CylVertex2TextBox.Name = "CylVertex2TextBox";
this.CylVertex2TextBox.Size = new System.Drawing.Size(457, 20);
this.CylVertex2TextBox.TabIndex = 22;
this.CylVertex2TextBox.TextChanged += new System.EventHandler(this.CylVertex2TextBox_TextChanged);
//
// CylVertex1TextBox
//
this.CylVertex1TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CylVertex1TextBox.Location = new System.Drawing.Point(92, 6);
this.CylVertex1TextBox.Name = "CylVertex1TextBox";
this.CylVertex1TextBox.Size = new System.Drawing.Size(457, 20);
this.CylVertex1TextBox.TabIndex = 20;
this.CylVertex1TextBox.TextChanged += new System.EventHandler(this.CylVertex1TextBox_TextChanged);
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(37, 35);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(49, 13);
this.label14.TabIndex = 21;
this.label14.Text = "Vertex 2:";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(37, 9);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(49, 13);
this.label15.TabIndex = 19;
this.label15.Text = "Vertex 1:";
// //
// BoxVertex4TextBox // BoxVertex4TextBox
// //
@ -669,23 +442,174 @@
this.label19.TabIndex = 15; this.label19.TabIndex = 15;
this.label19.Text = "Vertex 1:"; this.label19.Text = "Vertex 1:";
// //
// MatTypeCombo // CylinderTabPage
// //
this.MatTypeCombo.FormattingEnabled = true; this.CylinderTabPage.Controls.Add(this.CylRadiusTextBox);
this.MatTypeCombo.Location = new System.Drawing.Point(92, 6); this.CylinderTabPage.Controls.Add(this.label13);
this.MatTypeCombo.Name = "MatTypeCombo"; this.CylinderTabPage.Controls.Add(this.CylVertex2TextBox);
this.MatTypeCombo.Size = new System.Drawing.Size(195, 21); this.CylinderTabPage.Controls.Add(this.CylVertex1TextBox);
this.MatTypeCombo.TabIndex = 20; this.CylinderTabPage.Controls.Add(this.label14);
this.MatTypeCombo.SelectedIndexChanged += new System.EventHandler(this.MatTypeCombo_SelectedIndexChanged); this.CylinderTabPage.Controls.Add(this.label15);
this.CylinderTabPage.Location = new System.Drawing.Point(4, 22);
this.CylinderTabPage.Name = "CylinderTabPage";
this.CylinderTabPage.Size = new System.Drawing.Size(556, 128);
this.CylinderTabPage.TabIndex = 4;
this.CylinderTabPage.Text = "Cylinder";
this.CylinderTabPage.UseVisualStyleBackColor = true;
// //
// label20 // CylRadiusTextBox
// //
this.label20.AutoSize = true; this.CylRadiusTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.label20.Location = new System.Drawing.Point(39, 9); | System.Windows.Forms.AnchorStyles.Right)));
this.label20.Name = "label20"; this.CylRadiusTextBox.Location = new System.Drawing.Point(92, 58);
this.label20.Size = new System.Drawing.Size(47, 13); this.CylRadiusTextBox.Name = "CylRadiusTextBox";
this.label20.TabIndex = 19; this.CylRadiusTextBox.Size = new System.Drawing.Size(457, 20);
this.label20.Text = "Material:"; this.CylRadiusTextBox.TabIndex = 24;
this.CylRadiusTextBox.TextChanged += new System.EventHandler(this.CylRadiusTextBox_TextChanged);
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(37, 61);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(43, 13);
this.label13.TabIndex = 23;
this.label13.Text = "Radius:";
//
// CylVertex2TextBox
//
this.CylVertex2TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CylVertex2TextBox.Location = new System.Drawing.Point(92, 32);
this.CylVertex2TextBox.Name = "CylVertex2TextBox";
this.CylVertex2TextBox.Size = new System.Drawing.Size(457, 20);
this.CylVertex2TextBox.TabIndex = 22;
this.CylVertex2TextBox.TextChanged += new System.EventHandler(this.CylVertex2TextBox_TextChanged);
//
// CylVertex1TextBox
//
this.CylVertex1TextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CylVertex1TextBox.Location = new System.Drawing.Point(92, 6);
this.CylVertex1TextBox.Name = "CylVertex1TextBox";
this.CylVertex1TextBox.Size = new System.Drawing.Size(457, 20);
this.CylVertex1TextBox.TabIndex = 20;
this.CylVertex1TextBox.TextChanged += new System.EventHandler(this.CylVertex1TextBox_TextChanged);
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(37, 35);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(49, 13);
this.label14.TabIndex = 21;
this.label14.Text = "Vertex 2:";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(37, 9);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(49, 13);
this.label15.TabIndex = 19;
this.label15.Text = "Vertex 1:";
//
// MaterialTabControl
//
this.MaterialTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.MaterialTabControl.Controls.Add(this.MaterialTabPage);
this.MaterialTabControl.Location = new System.Drawing.Point(0, 151);
this.MaterialTabControl.Name = "MaterialTabControl";
this.MaterialTabControl.SelectedIndex = 0;
this.MaterialTabControl.Size = new System.Drawing.Size(564, 353);
this.MaterialTabControl.TabIndex = 1;
//
// MaterialTabPage
//
this.MaterialTabPage.Controls.Add(this.UpdateSharedMaterialCheckBox);
this.MaterialTabPage.Controls.Add(this.MatFlagsCheckedListBox);
this.MaterialTabPage.Controls.Add(this.MatColourUpDown);
this.MaterialTabPage.Controls.Add(this.label25);
this.MaterialTabPage.Controls.Add(this.MatUnkUpDown);
this.MaterialTabPage.Controls.Add(this.label21);
this.MaterialTabPage.Controls.Add(this.MatPedDensityUpDown);
this.MaterialTabPage.Controls.Add(this.label22);
this.MaterialTabPage.Controls.Add(this.MatRoomIDUpDown);
this.MaterialTabPage.Controls.Add(this.label23);
this.MaterialTabPage.Controls.Add(this.MatProceduralIDUpDown);
this.MaterialTabPage.Controls.Add(this.label24);
this.MaterialTabPage.Controls.Add(this.MatTypeCombo);
this.MaterialTabPage.Controls.Add(this.label20);
this.MaterialTabPage.Location = new System.Drawing.Point(4, 22);
this.MaterialTabPage.Name = "MaterialTabPage";
this.MaterialTabPage.Padding = new System.Windows.Forms.Padding(3);
this.MaterialTabPage.Size = new System.Drawing.Size(556, 327);
this.MaterialTabPage.TabIndex = 0;
this.MaterialTabPage.Text = "Material";
this.MaterialTabPage.UseVisualStyleBackColor = true;
//
// UpdateSharedMaterialCheckBox
//
this.UpdateSharedMaterialCheckBox.AutoSize = true;
this.UpdateSharedMaterialCheckBox.Location = new System.Drawing.Point(92, 172);
this.UpdateSharedMaterialCheckBox.Name = "UpdateSharedMaterialCheckBox";
this.UpdateSharedMaterialCheckBox.Size = new System.Drawing.Size(170, 17);
this.UpdateSharedMaterialCheckBox.TabIndex = 32;
this.UpdateSharedMaterialCheckBox.Text = "Update shared material on edit";
this.UpdateSharedMaterialCheckBox.UseVisualStyleBackColor = true;
//
// MatFlagsCheckedListBox
//
this.MatFlagsCheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.MatFlagsCheckedListBox.CheckOnClick = true;
this.MatFlagsCheckedListBox.FormattingEnabled = true;
this.MatFlagsCheckedListBox.Items.AddRange(new object[] {
"0 - Stairs",
"1 - Not Climbable",
"2 - See Through",
"3 - Shoot Through",
"4 - Not Cover",
"5 - Walkable Path",
"6 - No Cam Collision",
"7 - Shoot Through FX",
"8 - No Decal",
"9 - No Navmesh",
"10 - No Ragdoll",
"11 - Vehicle Wheel",
"12 - No PTFX",
"13 - Too Steep for Player",
"14 - No Network Spawn",
"15 - No Cam Collision Allow Clipping"});
this.MatFlagsCheckedListBox.Location = new System.Drawing.Point(326, 6);
this.MatFlagsCheckedListBox.Name = "MatFlagsCheckedListBox";
this.MatFlagsCheckedListBox.Size = new System.Drawing.Size(223, 319);
this.MatFlagsCheckedListBox.TabIndex = 31;
this.MatFlagsCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.MatFlagsCheckedListBox_ItemCheck);
//
// MatColourUpDown
//
this.MatColourUpDown.Location = new System.Drawing.Point(92, 33);
this.MatColourUpDown.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.MatColourUpDown.Name = "MatColourUpDown";
this.MatColourUpDown.Size = new System.Drawing.Size(64, 20);
this.MatColourUpDown.TabIndex = 22;
this.MatColourUpDown.ValueChanged += new System.EventHandler(this.MatColourUpDown_ValueChanged);
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(6, 35);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(80, 13);
this.label25.TabIndex = 21;
this.label25.Text = "Material Colour:";
// //
// MatUnkUpDown // MatUnkUpDown
// //
@ -775,66 +699,23 @@
this.label24.TabIndex = 23; this.label24.TabIndex = 23;
this.label24.Text = "Procedural ID:"; this.label24.Text = "Procedural ID:";
// //
// MatColourUpDown // MatTypeCombo
// //
this.MatColourUpDown.Location = new System.Drawing.Point(92, 33); this.MatTypeCombo.FormattingEnabled = true;
this.MatColourUpDown.Maximum = new decimal(new int[] { this.MatTypeCombo.Location = new System.Drawing.Point(92, 6);
255, this.MatTypeCombo.Name = "MatTypeCombo";
0, this.MatTypeCombo.Size = new System.Drawing.Size(195, 21);
0, this.MatTypeCombo.TabIndex = 20;
0}); this.MatTypeCombo.SelectedIndexChanged += new System.EventHandler(this.MatTypeCombo_SelectedIndexChanged);
this.MatColourUpDown.Name = "MatColourUpDown";
this.MatColourUpDown.Size = new System.Drawing.Size(64, 20);
this.MatColourUpDown.TabIndex = 22;
this.MatColourUpDown.ValueChanged += new System.EventHandler(this.MatColourUpDown_ValueChanged);
// //
// label25 // label20
// //
this.label25.AutoSize = true; this.label20.AutoSize = true;
this.label25.Location = new System.Drawing.Point(6, 35); this.label20.Location = new System.Drawing.Point(39, 9);
this.label25.Name = "label25"; this.label20.Name = "label20";
this.label25.Size = new System.Drawing.Size(80, 13); this.label20.Size = new System.Drawing.Size(47, 13);
this.label25.TabIndex = 21; this.label20.TabIndex = 19;
this.label25.Text = "Material Colour:"; this.label20.Text = "Material:";
//
// MatFlagsCheckedListBox
//
this.MatFlagsCheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.MatFlagsCheckedListBox.CheckOnClick = true;
this.MatFlagsCheckedListBox.FormattingEnabled = true;
this.MatFlagsCheckedListBox.Items.AddRange(new object[] {
"0 - Stairs",
"1 - Not Climbable",
"2 - See Through",
"3 - Shoot Through",
"4 - Not Cover",
"5 - Walkable Path",
"6 - No Cam Collision",
"7 - Shoot Through FX",
"8 - No Decal",
"9 - No Navmesh",
"10 - No Ragdoll",
"11 - Vehicle Wheel",
"12 - No PTFX",
"13 - Too Steep for Player",
"14 - No Network Spawn",
"15 - No Cam Collision Allow Clipping"});
this.MatFlagsCheckedListBox.Location = new System.Drawing.Point(326, 6);
this.MatFlagsCheckedListBox.Name = "MatFlagsCheckedListBox";
this.MatFlagsCheckedListBox.Size = new System.Drawing.Size(223, 244);
this.MatFlagsCheckedListBox.TabIndex = 31;
this.MatFlagsCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.MatFlagsCheckedListBox_ItemCheck);
//
// UpdateSharedMaterialCheckBox
//
this.UpdateSharedMaterialCheckBox.AutoSize = true;
this.UpdateSharedMaterialCheckBox.Location = new System.Drawing.Point(92, 172);
this.UpdateSharedMaterialCheckBox.Name = "UpdateSharedMaterialCheckBox";
this.UpdateSharedMaterialCheckBox.Size = new System.Drawing.Size(170, 17);
this.UpdateSharedMaterialCheckBox.TabIndex = 32;
this.UpdateSharedMaterialCheckBox.Text = "Update shared material on edit";
this.UpdateSharedMaterialCheckBox.UseVisualStyleBackColor = true;
// //
// DeleteButton // DeleteButton
// //
@ -881,17 +762,14 @@
this.BoxTabPage.PerformLayout(); this.BoxTabPage.PerformLayout();
this.CylinderTabPage.ResumeLayout(false); this.CylinderTabPage.ResumeLayout(false);
this.CylinderTabPage.PerformLayout(); this.CylinderTabPage.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.TriEdge1UpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.TriEdge2UpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.TriEdge3UpDown)).EndInit();
this.MaterialTabControl.ResumeLayout(false); this.MaterialTabControl.ResumeLayout(false);
this.MaterialTabPage.ResumeLayout(false); this.MaterialTabPage.ResumeLayout(false);
this.MaterialTabPage.PerformLayout(); this.MaterialTabPage.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.MatColourUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MatUnkUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.MatUnkUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MatPedDensityUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.MatPedDensityUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MatRoomIDUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.MatRoomIDUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MatProceduralIDUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.MatProceduralIDUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.MatColourUpDown)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -910,14 +788,6 @@
private System.Windows.Forms.TextBox TriVertex1TextBox; private System.Windows.Forms.TextBox TriVertex1TextBox;
private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox TriAreaTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.NumericUpDown TriEdge1UpDown;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.NumericUpDown TriEdge3UpDown;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.NumericUpDown TriEdge2UpDown;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckBox TriFlag3CheckBox; private System.Windows.Forms.CheckBox TriFlag3CheckBox;
private System.Windows.Forms.CheckBox TriFlag2CheckBox; private System.Windows.Forms.CheckBox TriFlag2CheckBox;
private System.Windows.Forms.CheckBox TriFlag1CheckBox; private System.Windows.Forms.CheckBox TriFlag1CheckBox;

View File

@ -87,10 +87,6 @@ namespace CodeWalker.Project.Panels
TriVertex1TextBox.Text = string.Empty; TriVertex1TextBox.Text = string.Empty;
TriVertex2TextBox.Text = string.Empty; TriVertex2TextBox.Text = string.Empty;
TriVertex3TextBox.Text = string.Empty; TriVertex3TextBox.Text = string.Empty;
TriAreaTextBox.Text = string.Empty;
TriEdge1UpDown.Value = 0;
TriEdge2UpDown.Value = 0;
TriEdge3UpDown.Value = 0;
TriFlag1CheckBox.Checked = false; TriFlag1CheckBox.Checked = false;
TriFlag2CheckBox.Checked = false; TriFlag2CheckBox.Checked = false;
TriFlag3CheckBox.Checked = false; TriFlag3CheckBox.Checked = false;
@ -123,10 +119,6 @@ namespace CodeWalker.Project.Panels
TriVertex1TextBox.Text = FloatUtil.GetVector3String(CollisionTriangle.Vertex1); TriVertex1TextBox.Text = FloatUtil.GetVector3String(CollisionTriangle.Vertex1);
TriVertex2TextBox.Text = FloatUtil.GetVector3String(CollisionTriangle.Vertex2); TriVertex2TextBox.Text = FloatUtil.GetVector3String(CollisionTriangle.Vertex2);
TriVertex3TextBox.Text = FloatUtil.GetVector3String(CollisionTriangle.Vertex3); TriVertex3TextBox.Text = FloatUtil.GetVector3String(CollisionTriangle.Vertex3);
TriAreaTextBox.Text = FloatUtil.ToString(CollisionTriangle.triArea);
TriEdge1UpDown.Value = CollisionTriangle.edgeIndex1;
TriEdge2UpDown.Value = CollisionTriangle.edgeIndex2;
TriEdge3UpDown.Value = CollisionTriangle.edgeIndex3;
TriFlag1CheckBox.Checked = CollisionTriangle.vertFlag1; TriFlag1CheckBox.Checked = CollisionTriangle.vertFlag1;
TriFlag2CheckBox.Checked = CollisionTriangle.vertFlag2; TriFlag2CheckBox.Checked = CollisionTriangle.vertFlag2;
TriFlag3CheckBox.Checked = CollisionTriangle.vertFlag3; TriFlag3CheckBox.Checked = CollisionTriangle.vertFlag3;
@ -301,66 +293,6 @@ namespace CodeWalker.Project.Panels
} }
} }
private void TriAreaTextBox_TextChanged(object sender, EventArgs e)
{
if (CollisionTriangle == null) return;
if (populatingui) return;
var v = FloatUtil.Parse(TriAreaTextBox.Text);
lock (ProjectForm.ProjectSyncRoot)
{
if (CollisionTriangle.triArea != v)
{
CollisionTriangle.triArea = v;
ProjectForm.SetYbnHasChanged(true);
}
}
}
private void TriEdge1UpDown_ValueChanged(object sender, EventArgs e)
{
if (CollisionTriangle == null) return;
if (populatingui) return;
var v = (short)TriEdge1UpDown.Value;
lock (ProjectForm.ProjectSyncRoot)
{
if (CollisionTriangle.edgeIndex1 != v)
{
CollisionTriangle.edgeIndex1 = v;
ProjectForm.SetYbnHasChanged(true);
}
}
}
private void TriEdge2UpDown_ValueChanged(object sender, EventArgs e)
{
if (CollisionTriangle == null) return;
if (populatingui) return;
var v = (short)TriEdge2UpDown.Value;
lock (ProjectForm.ProjectSyncRoot)
{
if (CollisionTriangle.edgeIndex2 != v)
{
CollisionTriangle.edgeIndex2 = v;
ProjectForm.SetYbnHasChanged(true);
}
}
}
private void TriEdge3UpDown_ValueChanged(object sender, EventArgs e)
{
if (CollisionTriangle == null) return;
if (populatingui) return;
var v = (short)TriEdge3UpDown.Value;
lock (ProjectForm.ProjectSyncRoot)
{
if (CollisionTriangle.edgeIndex3 != v)
{
CollisionTriangle.edgeIndex3 = v;
ProjectForm.SetYbnHasChanged(true);
}
}
}
private void TriFlag1CheckBox_CheckedChanged(object sender, EventArgs e) private void TriFlag1CheckBox_CheckedChanged(object sender, EventArgs e)
{ {
if (CollisionTriangle == null) return; if (CollisionTriangle == null) return;

View File

@ -31,6 +31,8 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditYbnBoundsPanel)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditYbnBoundsPanel));
this.BoundsTabControl = new System.Windows.Forms.TabControl(); this.BoundsTabControl = new System.Windows.Forms.TabControl();
this.BoundsTabPage = new System.Windows.Forms.TabPage(); this.BoundsTabPage = new System.Windows.Forms.TabPage();
this.DeleteButton = new System.Windows.Forms.Button();
this.AddToProjectButton = new System.Windows.Forms.Button();
this.MaterialCombo = new System.Windows.Forms.ComboBox(); this.MaterialCombo = new System.Windows.Forms.ComboBox();
this.UnkTypeUpDown = new System.Windows.Forms.NumericUpDown(); this.UnkTypeUpDown = new System.Windows.Forms.NumericUpDown();
this.label16 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label();
@ -74,8 +76,18 @@
this.label18 = new System.Windows.Forms.Label(); this.label18 = new System.Windows.Forms.Label();
this.CenterGeomTextBox = new System.Windows.Forms.TextBox(); this.CenterGeomTextBox = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label();
this.DeleteButton = new System.Windows.Forms.Button(); this.CompositeFlagsTabPage = new System.Windows.Forms.TabPage();
this.AddToProjectButton = new System.Windows.Forms.Button(); this.CompFlags1CheckedListBox = new System.Windows.Forms.CheckedListBox();
this.label21 = new System.Windows.Forms.Label();
this.label22 = new System.Windows.Forms.Label();
this.CompFlags2CheckedListBox = new System.Windows.Forms.CheckedListBox();
this.CompositeXformTabPage = new System.Windows.Forms.TabPage();
this.CompScaleTextBox = new System.Windows.Forms.TextBox();
this.label23 = new System.Windows.Forms.Label();
this.CompRotationTextBox = new System.Windows.Forms.TextBox();
this.CompPositionTextBox = new System.Windows.Forms.TextBox();
this.label24 = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
this.BoundsTabControl.SuspendLayout(); this.BoundsTabControl.SuspendLayout();
this.BoundsTabPage.SuspendLayout(); this.BoundsTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.UnkTypeUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.UnkTypeUpDown)).BeginInit();
@ -86,17 +98,21 @@
((System.ComponentModel.ISupportInitialize)(this.RoomIDUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.RoomIDUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ProceduralIDUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ProceduralIDUpDown)).BeginInit();
this.GeometryTabPage.SuspendLayout(); this.GeometryTabPage.SuspendLayout();
this.CompositeFlagsTabPage.SuspendLayout();
this.CompositeXformTabPage.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// BoundsTabControl // BoundsTabControl
// //
this.BoundsTabControl.Controls.Add(this.BoundsTabPage); this.BoundsTabControl.Controls.Add(this.BoundsTabPage);
this.BoundsTabControl.Controls.Add(this.GeometryTabPage); this.BoundsTabControl.Controls.Add(this.GeometryTabPage);
this.BoundsTabControl.Controls.Add(this.CompositeFlagsTabPage);
this.BoundsTabControl.Controls.Add(this.CompositeXformTabPage);
this.BoundsTabControl.Dock = System.Windows.Forms.DockStyle.Fill; this.BoundsTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.BoundsTabControl.Location = new System.Drawing.Point(0, 0); this.BoundsTabControl.Location = new System.Drawing.Point(0, 0);
this.BoundsTabControl.Name = "BoundsTabControl"; this.BoundsTabControl.Name = "BoundsTabControl";
this.BoundsTabControl.SelectedIndex = 0; this.BoundsTabControl.SelectedIndex = 0;
this.BoundsTabControl.Size = new System.Drawing.Size(565, 505); this.BoundsTabControl.Size = new System.Drawing.Size(607, 515);
this.BoundsTabControl.TabIndex = 0; this.BoundsTabControl.TabIndex = 0;
// //
// BoundsTabPage // BoundsTabPage
@ -138,11 +154,33 @@
this.BoundsTabPage.Location = new System.Drawing.Point(4, 22); this.BoundsTabPage.Location = new System.Drawing.Point(4, 22);
this.BoundsTabPage.Name = "BoundsTabPage"; this.BoundsTabPage.Name = "BoundsTabPage";
this.BoundsTabPage.Padding = new System.Windows.Forms.Padding(3); this.BoundsTabPage.Padding = new System.Windows.Forms.Padding(3);
this.BoundsTabPage.Size = new System.Drawing.Size(557, 479); this.BoundsTabPage.Size = new System.Drawing.Size(599, 489);
this.BoundsTabPage.TabIndex = 0; this.BoundsTabPage.TabIndex = 0;
this.BoundsTabPage.Text = "Bounds"; this.BoundsTabPage.Text = "Bounds";
this.BoundsTabPage.UseVisualStyleBackColor = true; this.BoundsTabPage.UseVisualStyleBackColor = true;
// //
// DeleteButton
//
this.DeleteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.DeleteButton.Location = new System.Drawing.Point(496, 238);
this.DeleteButton.Name = "DeleteButton";
this.DeleteButton.Size = new System.Drawing.Size(95, 23);
this.DeleteButton.TabIndex = 36;
this.DeleteButton.Text = "Delete Bounds";
this.DeleteButton.UseVisualStyleBackColor = true;
this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click);
//
// AddToProjectButton
//
this.AddToProjectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.AddToProjectButton.Location = new System.Drawing.Point(395, 238);
this.AddToProjectButton.Name = "AddToProjectButton";
this.AddToProjectButton.Size = new System.Drawing.Size(95, 23);
this.AddToProjectButton.TabIndex = 35;
this.AddToProjectButton.Text = "Add to Project";
this.AddToProjectButton.UseVisualStyleBackColor = true;
this.AddToProjectButton.Click += new System.EventHandler(this.AddToProjectButton_Click);
//
// MaterialCombo // MaterialCombo
// //
this.MaterialCombo.FormattingEnabled = true; this.MaterialCombo.FormattingEnabled = true;
@ -189,7 +227,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.UnkVectorTextBox.Location = new System.Drawing.Point(91, 188); this.UnkVectorTextBox.Location = new System.Drawing.Point(91, 188);
this.UnkVectorTextBox.Name = "UnkVectorTextBox"; this.UnkVectorTextBox.Name = "UnkVectorTextBox";
this.UnkVectorTextBox.Size = new System.Drawing.Size(458, 20); this.UnkVectorTextBox.Size = new System.Drawing.Size(500, 20);
this.UnkVectorTextBox.TabIndex = 16; this.UnkVectorTextBox.TabIndex = 16;
this.UnkVectorTextBox.TextChanged += new System.EventHandler(this.UnkVectorTextBox_TextChanged); this.UnkVectorTextBox.TextChanged += new System.EventHandler(this.UnkVectorTextBox_TextChanged);
// //
@ -208,7 +246,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.VolumeTextBox.Location = new System.Drawing.Point(91, 162); this.VolumeTextBox.Location = new System.Drawing.Point(91, 162);
this.VolumeTextBox.Name = "VolumeTextBox"; this.VolumeTextBox.Name = "VolumeTextBox";
this.VolumeTextBox.Size = new System.Drawing.Size(458, 20); this.VolumeTextBox.Size = new System.Drawing.Size(500, 20);
this.VolumeTextBox.TabIndex = 14; this.VolumeTextBox.TabIndex = 14;
this.VolumeTextBox.TextChanged += new System.EventHandler(this.VolumeTextBox_TextChanged); this.VolumeTextBox.TextChanged += new System.EventHandler(this.VolumeTextBox_TextChanged);
// //
@ -368,7 +406,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.MarginTextBox.Location = new System.Drawing.Point(91, 136); this.MarginTextBox.Location = new System.Drawing.Point(91, 136);
this.MarginTextBox.Name = "MarginTextBox"; this.MarginTextBox.Name = "MarginTextBox";
this.MarginTextBox.Size = new System.Drawing.Size(458, 20); this.MarginTextBox.Size = new System.Drawing.Size(500, 20);
this.MarginTextBox.TabIndex = 12; this.MarginTextBox.TabIndex = 12;
this.MarginTextBox.TextChanged += new System.EventHandler(this.MarginTextBox_TextChanged); this.MarginTextBox.TextChanged += new System.EventHandler(this.MarginTextBox_TextChanged);
// //
@ -378,7 +416,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.BBCenterTextBox.Location = new System.Drawing.Point(91, 58); this.BBCenterTextBox.Location = new System.Drawing.Point(91, 58);
this.BBCenterTextBox.Name = "BBCenterTextBox"; this.BBCenterTextBox.Name = "BBCenterTextBox";
this.BBCenterTextBox.Size = new System.Drawing.Size(458, 20); this.BBCenterTextBox.Size = new System.Drawing.Size(500, 20);
this.BBCenterTextBox.TabIndex = 6; this.BBCenterTextBox.TabIndex = 6;
this.BBCenterTextBox.TextChanged += new System.EventHandler(this.BBCenterTextBox_TextChanged); this.BBCenterTextBox.TextChanged += new System.EventHandler(this.BBCenterTextBox_TextChanged);
// //
@ -406,7 +444,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.BSRadiusTextBox.Location = new System.Drawing.Point(91, 110); this.BSRadiusTextBox.Location = new System.Drawing.Point(91, 110);
this.BSRadiusTextBox.Name = "BSRadiusTextBox"; this.BSRadiusTextBox.Name = "BSRadiusTextBox";
this.BSRadiusTextBox.Size = new System.Drawing.Size(458, 20); this.BSRadiusTextBox.Size = new System.Drawing.Size(500, 20);
this.BSRadiusTextBox.TabIndex = 10; this.BSRadiusTextBox.TabIndex = 10;
this.BSRadiusTextBox.TextChanged += new System.EventHandler(this.BSRadiusTextBox_TextChanged); this.BSRadiusTextBox.TextChanged += new System.EventHandler(this.BSRadiusTextBox_TextChanged);
// //
@ -416,7 +454,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.BSCenterTextBox.Location = new System.Drawing.Point(91, 84); this.BSCenterTextBox.Location = new System.Drawing.Point(91, 84);
this.BSCenterTextBox.Name = "BSCenterTextBox"; this.BSCenterTextBox.Name = "BSCenterTextBox";
this.BSCenterTextBox.Size = new System.Drawing.Size(458, 20); this.BSCenterTextBox.Size = new System.Drawing.Size(500, 20);
this.BSCenterTextBox.TabIndex = 8; this.BSCenterTextBox.TabIndex = 8;
this.BSCenterTextBox.TextChanged += new System.EventHandler(this.BSCenterTextBox_TextChanged); this.BSCenterTextBox.TextChanged += new System.EventHandler(this.BSCenterTextBox_TextChanged);
// //
@ -435,7 +473,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.BBMaxTextBox.Location = new System.Drawing.Point(91, 32); this.BBMaxTextBox.Location = new System.Drawing.Point(91, 32);
this.BBMaxTextBox.Name = "BBMaxTextBox"; this.BBMaxTextBox.Name = "BBMaxTextBox";
this.BBMaxTextBox.Size = new System.Drawing.Size(458, 20); this.BBMaxTextBox.Size = new System.Drawing.Size(500, 20);
this.BBMaxTextBox.TabIndex = 4; this.BBMaxTextBox.TabIndex = 4;
this.BBMaxTextBox.TextChanged += new System.EventHandler(this.BBMaxTextBox_TextChanged); this.BBMaxTextBox.TextChanged += new System.EventHandler(this.BBMaxTextBox_TextChanged);
// //
@ -445,7 +483,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.BBMinTextBox.Location = new System.Drawing.Point(91, 6); this.BBMinTextBox.Location = new System.Drawing.Point(91, 6);
this.BBMinTextBox.Name = "BBMinTextBox"; this.BBMinTextBox.Name = "BBMinTextBox";
this.BBMinTextBox.Size = new System.Drawing.Size(458, 20); this.BBMinTextBox.Size = new System.Drawing.Size(500, 20);
this.BBMinTextBox.TabIndex = 2; this.BBMinTextBox.TabIndex = 2;
this.BBMinTextBox.TextChanged += new System.EventHandler(this.BBMinTextBox_TextChanged); this.BBMinTextBox.TextChanged += new System.EventHandler(this.BBMinTextBox_TextChanged);
// //
@ -482,7 +520,7 @@
this.GeometryTabPage.Location = new System.Drawing.Point(4, 22); this.GeometryTabPage.Location = new System.Drawing.Point(4, 22);
this.GeometryTabPage.Name = "GeometryTabPage"; this.GeometryTabPage.Name = "GeometryTabPage";
this.GeometryTabPage.Padding = new System.Windows.Forms.Padding(3); this.GeometryTabPage.Padding = new System.Windows.Forms.Padding(3);
this.GeometryTabPage.Size = new System.Drawing.Size(557, 479); this.GeometryTabPage.Size = new System.Drawing.Size(599, 489);
this.GeometryTabPage.TabIndex = 1; this.GeometryTabPage.TabIndex = 1;
this.GeometryTabPage.Text = "Geometry"; this.GeometryTabPage.Text = "Geometry";
this.GeometryTabPage.UseVisualStyleBackColor = true; this.GeometryTabPage.UseVisualStyleBackColor = true;
@ -511,7 +549,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.UnkFloat2TextBox.Location = new System.Drawing.Point(91, 84); this.UnkFloat2TextBox.Location = new System.Drawing.Point(91, 84);
this.UnkFloat2TextBox.Name = "UnkFloat2TextBox"; this.UnkFloat2TextBox.Name = "UnkFloat2TextBox";
this.UnkFloat2TextBox.Size = new System.Drawing.Size(458, 20); this.UnkFloat2TextBox.Size = new System.Drawing.Size(500, 20);
this.UnkFloat2TextBox.TabIndex = 10; this.UnkFloat2TextBox.TabIndex = 10;
this.UnkFloat2TextBox.TextChanged += new System.EventHandler(this.UnkFloat2TextBox_TextChanged); this.UnkFloat2TextBox.TextChanged += new System.EventHandler(this.UnkFloat2TextBox_TextChanged);
// //
@ -530,7 +568,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.UnkFloat1TextBox.Location = new System.Drawing.Point(91, 58); this.UnkFloat1TextBox.Location = new System.Drawing.Point(91, 58);
this.UnkFloat1TextBox.Name = "UnkFloat1TextBox"; this.UnkFloat1TextBox.Name = "UnkFloat1TextBox";
this.UnkFloat1TextBox.Size = new System.Drawing.Size(458, 20); this.UnkFloat1TextBox.Size = new System.Drawing.Size(500, 20);
this.UnkFloat1TextBox.TabIndex = 8; this.UnkFloat1TextBox.TabIndex = 8;
this.UnkFloat1TextBox.TextChanged += new System.EventHandler(this.UnkFloat1TextBox_TextChanged); this.UnkFloat1TextBox.TextChanged += new System.EventHandler(this.UnkFloat1TextBox_TextChanged);
// //
@ -549,7 +587,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.QuantumTextBox.Location = new System.Drawing.Point(91, 32); this.QuantumTextBox.Location = new System.Drawing.Point(91, 32);
this.QuantumTextBox.Name = "QuantumTextBox"; this.QuantumTextBox.Name = "QuantumTextBox";
this.QuantumTextBox.Size = new System.Drawing.Size(458, 20); this.QuantumTextBox.Size = new System.Drawing.Size(500, 20);
this.QuantumTextBox.TabIndex = 6; this.QuantumTextBox.TabIndex = 6;
this.QuantumTextBox.TextChanged += new System.EventHandler(this.QuantumTextBox_TextChanged); this.QuantumTextBox.TextChanged += new System.EventHandler(this.QuantumTextBox_TextChanged);
// //
@ -568,7 +606,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.CenterGeomTextBox.Location = new System.Drawing.Point(91, 6); this.CenterGeomTextBox.Location = new System.Drawing.Point(91, 6);
this.CenterGeomTextBox.Name = "CenterGeomTextBox"; this.CenterGeomTextBox.Name = "CenterGeomTextBox";
this.CenterGeomTextBox.Size = new System.Drawing.Size(458, 20); this.CenterGeomTextBox.Size = new System.Drawing.Size(500, 20);
this.CenterGeomTextBox.TabIndex = 4; this.CenterGeomTextBox.TabIndex = 4;
this.CenterGeomTextBox.TextChanged += new System.EventHandler(this.CenterGeomTextBox_TextChanged); this.CenterGeomTextBox.TextChanged += new System.EventHandler(this.CenterGeomTextBox_TextChanged);
// //
@ -581,33 +619,204 @@
this.label17.TabIndex = 3; this.label17.TabIndex = 3;
this.label17.Text = "Geom Center:"; this.label17.Text = "Geom Center:";
// //
// DeleteButton // CompositeFlagsTabPage
// //
this.DeleteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.CompositeFlagsTabPage.Controls.Add(this.label22);
this.DeleteButton.Location = new System.Drawing.Point(454, 238); this.CompositeFlagsTabPage.Controls.Add(this.CompFlags2CheckedListBox);
this.DeleteButton.Name = "DeleteButton"; this.CompositeFlagsTabPage.Controls.Add(this.label21);
this.DeleteButton.Size = new System.Drawing.Size(95, 23); this.CompositeFlagsTabPage.Controls.Add(this.CompFlags1CheckedListBox);
this.DeleteButton.TabIndex = 36; this.CompositeFlagsTabPage.Location = new System.Drawing.Point(4, 22);
this.DeleteButton.Text = "Delete Bounds"; this.CompositeFlagsTabPage.Name = "CompositeFlagsTabPage";
this.DeleteButton.UseVisualStyleBackColor = true; this.CompositeFlagsTabPage.Size = new System.Drawing.Size(599, 489);
this.DeleteButton.Click += new System.EventHandler(this.DeleteButton_Click); this.CompositeFlagsTabPage.TabIndex = 2;
this.CompositeFlagsTabPage.Text = "Composite Flags";
this.CompositeFlagsTabPage.UseVisualStyleBackColor = true;
// //
// AddToProjectButton // CompFlags1CheckedListBox
// //
this.AddToProjectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.CompFlags1CheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.AddToProjectButton.Location = new System.Drawing.Point(353, 238); | System.Windows.Forms.AnchorStyles.Left)));
this.AddToProjectButton.Name = "AddToProjectButton"; this.CompFlags1CheckedListBox.CheckOnClick = true;
this.AddToProjectButton.Size = new System.Drawing.Size(95, 23); this.CompFlags1CheckedListBox.FormattingEnabled = true;
this.AddToProjectButton.TabIndex = 35; this.CompFlags1CheckedListBox.Items.AddRange(new object[] {
this.AddToProjectButton.Text = "Add to Project"; "0 - Unknown",
this.AddToProjectButton.UseVisualStyleBackColor = true; "1 - Map Weapon",
this.AddToProjectButton.Click += new System.EventHandler(this.AddToProjectButton_Click); "2 - Map Dynamic",
"3 - Map Animal",
"4 - Map Cover",
"5 - Map Vehicle",
"6 - Vehicle Not BVH",
"7 - Vehicle BVH",
"8 - Vehicle Box",
"9 - Ped",
"10 - Ragdoll",
"11 - Animal",
"12 - Animal Ragdoll",
"13 - Object",
"14 - Object Env Cloth",
"15 - Plant",
"16 - Projectile",
"17 - Explosion",
"18 - Pickup",
"19 - Foliage",
"20 - Forklift Forks",
"21 - Test Weapon",
"22 - Test Camera",
"23 - Test AI",
"24 - Test Script",
"25 - Test Vehicle Wheel",
"26 - Glass",
"27 - Map River",
"28 - Smoke",
"29 - Unsmashed",
"30 - Map Stairs",
"31 - Map Deep Surface"});
this.CompFlags1CheckedListBox.Location = new System.Drawing.Point(53, 3);
this.CompFlags1CheckedListBox.Name = "CompFlags1CheckedListBox";
this.CompFlags1CheckedListBox.Size = new System.Drawing.Size(174, 484);
this.CompFlags1CheckedListBox.TabIndex = 32;
this.CompFlags1CheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.CompFlags1CheckedListBox_ItemCheck);
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(3, 3);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(44, 13);
this.label21.TabIndex = 33;
this.label21.Text = "Flags 1:";
//
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(256, 3);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(44, 13);
this.label22.TabIndex = 35;
this.label22.Text = "Flags 2:";
//
// CompFlags2CheckedListBox
//
this.CompFlags2CheckedListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.CompFlags2CheckedListBox.CheckOnClick = true;
this.CompFlags2CheckedListBox.FormattingEnabled = true;
this.CompFlags2CheckedListBox.Items.AddRange(new object[] {
"0 - Unknown",
"1 - Map Weapon",
"2 - Map Dynamic",
"3 - Map Animal",
"4 - Map Cover",
"5 - Map Vehicle",
"6 - Vehicle Not BVH",
"7 - Vehicle BVH",
"8 - Vehicle Box",
"9 - Ped",
"10 - Ragdoll",
"11 - Animal",
"12 - Animal Ragdoll",
"13 - Object",
"14 - Object Env Cloth",
"15 - Plant",
"16 - Projectile",
"17 - Explosion",
"18 - Pickup",
"19 - Foliage",
"20 - Forklift Forks",
"21 - Test Weapon",
"22 - Test Camera",
"23 - Test AI",
"24 - Test Script",
"25 - Test Vehicle Wheel",
"26 - Glass",
"27 - Map River",
"28 - Smoke",
"29 - Unsmashed",
"30 - Map Stairs",
"31 - Map Deep Surface"});
this.CompFlags2CheckedListBox.Location = new System.Drawing.Point(306, 3);
this.CompFlags2CheckedListBox.Name = "CompFlags2CheckedListBox";
this.CompFlags2CheckedListBox.Size = new System.Drawing.Size(174, 484);
this.CompFlags2CheckedListBox.TabIndex = 34;
this.CompFlags2CheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.CompFlags2CheckedListBox_ItemCheck);
//
// CompositeXformTabPage
//
this.CompositeXformTabPage.Controls.Add(this.CompScaleTextBox);
this.CompositeXformTabPage.Controls.Add(this.label23);
this.CompositeXformTabPage.Controls.Add(this.CompRotationTextBox);
this.CompositeXformTabPage.Controls.Add(this.CompPositionTextBox);
this.CompositeXformTabPage.Controls.Add(this.label24);
this.CompositeXformTabPage.Controls.Add(this.label25);
this.CompositeXformTabPage.Location = new System.Drawing.Point(4, 22);
this.CompositeXformTabPage.Name = "CompositeXformTabPage";
this.CompositeXformTabPage.Size = new System.Drawing.Size(599, 489);
this.CompositeXformTabPage.TabIndex = 3;
this.CompositeXformTabPage.Text = "Composite Transform";
this.CompositeXformTabPage.UseVisualStyleBackColor = true;
//
// CompScaleTextBox
//
this.CompScaleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CompScaleTextBox.Location = new System.Drawing.Point(72, 64);
this.CompScaleTextBox.Name = "CompScaleTextBox";
this.CompScaleTextBox.Size = new System.Drawing.Size(500, 20);
this.CompScaleTextBox.TabIndex = 12;
this.CompScaleTextBox.TextChanged += new System.EventHandler(this.CompScaleTextBox_TextChanged);
//
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(29, 67);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(37, 13);
this.label23.TabIndex = 11;
this.label23.Text = "Scale:";
//
// CompRotationTextBox
//
this.CompRotationTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CompRotationTextBox.Location = new System.Drawing.Point(72, 38);
this.CompRotationTextBox.Name = "CompRotationTextBox";
this.CompRotationTextBox.Size = new System.Drawing.Size(500, 20);
this.CompRotationTextBox.TabIndex = 10;
this.CompRotationTextBox.TextChanged += new System.EventHandler(this.CompRotationTextBox_TextChanged);
//
// CompPositionTextBox
//
this.CompPositionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CompPositionTextBox.Location = new System.Drawing.Point(72, 12);
this.CompPositionTextBox.Name = "CompPositionTextBox";
this.CompPositionTextBox.Size = new System.Drawing.Size(500, 20);
this.CompPositionTextBox.TabIndex = 8;
this.CompPositionTextBox.TextChanged += new System.EventHandler(this.CompPositionTextBox_TextChanged);
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(16, 41);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(50, 13);
this.label24.TabIndex = 9;
this.label24.Text = "Rotation:";
//
// label25
//
this.label25.AutoSize = true;
this.label25.Location = new System.Drawing.Point(19, 15);
this.label25.Name = "label25";
this.label25.Size = new System.Drawing.Size(47, 13);
this.label25.TabIndex = 7;
this.label25.Text = "Position:";
// //
// EditYbnBoundsPanel // EditYbnBoundsPanel
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(565, 505); this.ClientSize = new System.Drawing.Size(607, 515);
this.Controls.Add(this.BoundsTabControl); this.Controls.Add(this.BoundsTabControl);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "EditYbnBoundsPanel"; this.Name = "EditYbnBoundsPanel";
@ -624,6 +833,10 @@
((System.ComponentModel.ISupportInitialize)(this.ProceduralIDUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.ProceduralIDUpDown)).EndInit();
this.GeometryTabPage.ResumeLayout(false); this.GeometryTabPage.ResumeLayout(false);
this.GeometryTabPage.PerformLayout(); this.GeometryTabPage.PerformLayout();
this.CompositeFlagsTabPage.ResumeLayout(false);
this.CompositeFlagsTabPage.PerformLayout();
this.CompositeXformTabPage.ResumeLayout(false);
this.CompositeXformTabPage.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -677,5 +890,17 @@
private System.Windows.Forms.Label VertexCountLabel; private System.Windows.Forms.Label VertexCountLabel;
private System.Windows.Forms.Button DeleteButton; private System.Windows.Forms.Button DeleteButton;
private System.Windows.Forms.Button AddToProjectButton; private System.Windows.Forms.Button AddToProjectButton;
private System.Windows.Forms.TabPage CompositeFlagsTabPage;
private System.Windows.Forms.CheckedListBox CompFlags1CheckedListBox;
private System.Windows.Forms.Label label22;
private System.Windows.Forms.CheckedListBox CompFlags2CheckedListBox;
private System.Windows.Forms.Label label21;
private System.Windows.Forms.TabPage CompositeXformTabPage;
private System.Windows.Forms.TextBox CompScaleTextBox;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.TextBox CompRotationTextBox;
private System.Windows.Forms.TextBox CompPositionTextBox;
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Label label25;
} }
} }

View File

@ -93,10 +93,17 @@ namespace CodeWalker.Project.Panels
UnkFlagsUpDown.Value = 0; UnkFlagsUpDown.Value = 0;
UnkTypeUpDown.Value = 0; UnkTypeUpDown.Value = 0;
BoundsTabControl.TabPages.Remove(GeometryTabPage); BoundsTabControl.TabPages.Remove(GeometryTabPage);
BoundsTabControl.TabPages.Remove(CompositeFlagsTabPage);
BoundsTabControl.TabPages.Remove(CompositeXformTabPage);
CenterGeomTextBox.Text = string.Empty; CenterGeomTextBox.Text = string.Empty;
QuantumTextBox.Text = string.Empty; QuantumTextBox.Text = string.Empty;
UnkFloat1TextBox.Text = string.Empty; UnkFloat1TextBox.Text = string.Empty;
UnkFloat2TextBox.Text = string.Empty; UnkFloat2TextBox.Text = string.Empty;
SetCheckedListBoxValues(CompFlags1CheckedListBox, 0);
SetCheckedListBoxValues(CompFlags2CheckedListBox, 0);
CompPositionTextBox.Text = string.Empty;
CompRotationTextBox.Text = string.Empty;
CompScaleTextBox.Text = string.Empty;
VertexCountLabel.Text = "0 vertices"; VertexCountLabel.Text = "0 vertices";
PolyCountLabel.Text = "0 polygons"; PolyCountLabel.Text = "0 polygons";
} }
@ -146,6 +153,34 @@ namespace CodeWalker.Project.Panels
PolyCountLabel.Text = "0 polygons"; PolyCountLabel.Text = "0 polygons";
} }
if (b.Parent != null)
{
if (!BoundsTabControl.TabPages.Contains(CompositeFlagsTabPage))
{
BoundsTabControl.TabPages.Add(CompositeFlagsTabPage);
}
if (!BoundsTabControl.TabPages.Contains(CompositeXformTabPage))
{
BoundsTabControl.TabPages.Add(CompositeXformTabPage);
}
SetCheckedListBoxValues(CompFlags1CheckedListBox, (uint)b.CompositeFlags1.Flags1);
SetCheckedListBoxValues(CompFlags2CheckedListBox, (uint)b.CompositeFlags1.Flags2);
CompPositionTextBox.Text = FloatUtil.GetVector3String(b.Position);
CompRotationTextBox.Text = FloatUtil.GetVector4String(b.Orientation.ToVector4());
CompScaleTextBox.Text = FloatUtil.GetVector3String(b.Scale);
}
else
{
BoundsTabControl.TabPages.Remove(CompositeFlagsTabPage);
BoundsTabControl.TabPages.Remove(CompositeXformTabPage);
SetCheckedListBoxValues(CompFlags1CheckedListBox, 0);
SetCheckedListBoxValues(CompFlags2CheckedListBox, 0);
CompPositionTextBox.Text = string.Empty;
CompRotationTextBox.Text = string.Empty;
CompScaleTextBox.Text = string.Empty;
}
var ybn = b.GetRootYbn(); var ybn = b.GetRootYbn();
AddToProjectButton.Enabled = (ybn != null) ? !ProjectForm.YbnExistsInProject(ybn) : false; AddToProjectButton.Enabled = (ybn != null) ? !ProjectForm.YbnExistsInProject(ybn) : false;
DeleteButton.Enabled = !AddToProjectButton.Enabled; DeleteButton.Enabled = !AddToProjectButton.Enabled;
@ -156,6 +191,39 @@ namespace CodeWalker.Project.Panels
} }
} }
private void SetCheckedListBoxValues(CheckedListBox clb, uint flags)
{
for (int i = 0; i < clb.Items.Count; i++)
{
var c = ((flags & (1 << i)) > 0);
clb.SetItemCheckState(i, c ? CheckState.Checked : CheckState.Unchecked);
}
}
private uint GetCheckedListBoxValues(CheckedListBox clb, ItemCheckEventArgs e)
{
uint r = 0;
for (int i = 0; i < clb.Items.Count; i++)
{
if ((e != null) && (e.Index == i))
{
if (e.NewValue == CheckState.Checked)
{
r += (uint)(1 << i);
}
}
else
{
bool v = clb.GetItemChecked(i);// == CheckState.Checked;
r = BitUtil.UpdateBit(r, i, v);
}
}
return r;
}
private void BBMinTextBox_TextChanged(object sender, EventArgs e) private void BBMinTextBox_TextChanged(object sender, EventArgs e)
{ {
if (CollisionBounds == null) return; if (CollisionBounds == null) return;
@ -456,6 +524,83 @@ namespace CodeWalker.Project.Panels
} }
} }
private void CompFlags1CheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (CollisionBounds == null) return;
if (populatingui) return;
var f1 = CollisionBounds.CompositeFlags1;
var f2 = CollisionBounds.CompositeFlags2;
var v = (EBoundCompositeFlags)GetCheckedListBoxValues(CompFlags1CheckedListBox, e);
if ((f1.Flags1 != v) || (f2.Flags1 != v))
{
f1.Flags1 = v;
CollisionBounds.CompositeFlags1 = f1;
CollisionBounds.CompositeFlags2 = f1;
ProjectForm.SetYbnHasChanged(true);
}
}
private void CompFlags2CheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (CollisionBounds == null) return;
if (populatingui) return;
var f1 = CollisionBounds.CompositeFlags1;
var f2 = CollisionBounds.CompositeFlags2;
var v = (EBoundCompositeFlags)GetCheckedListBoxValues(CompFlags2CheckedListBox, e);
if ((f1.Flags2 != v) || (f2.Flags2 != v))
{
f1.Flags2 = v;
CollisionBounds.CompositeFlags1 = f1;
CollisionBounds.CompositeFlags2 = f1;
ProjectForm.SetYbnHasChanged(true);
}
}
private void CompPositionTextBox_TextChanged(object sender, EventArgs e)
{
if (CollisionBounds == null) return;
if (populatingui) return;
var v = FloatUtil.ParseVector3String(CompPositionTextBox.Text);
lock (ProjectForm.ProjectSyncRoot)
{
if (CollisionBounds.Position != v)
{
CollisionBounds.Position = v;
ProjectForm.SetYbnHasChanged(true);
}
}
}
private void CompRotationTextBox_TextChanged(object sender, EventArgs e)
{
if (CollisionBounds == null) return;
if (populatingui) return;
var q = FloatUtil.ParseVector4String(CompRotationTextBox.Text).ToQuaternion();
lock (ProjectForm.ProjectSyncRoot)
{
if (CollisionBounds.Orientation != q)
{
CollisionBounds.Orientation = q;
ProjectForm.SetYbnHasChanged(true);
}
}
}
private void CompScaleTextBox_TextChanged(object sender, EventArgs e)
{
if (CollisionBounds == null) return;
if (populatingui) return;
var v = FloatUtil.ParseVector3String(CompScaleTextBox.Text);
lock (ProjectForm.ProjectSyncRoot)
{
if (CollisionBounds.Scale != v)
{
CollisionBounds.Scale = v;
ProjectForm.SetYbnHasChanged(true);
}
}
}
private void AddToProjectButton_Click(object sender, EventArgs e) private void AddToProjectButton_Click(object sender, EventArgs e)
{ {
ProjectForm.SetProjectItem(CollisionBounds); ProjectForm.SetProjectItem(CollisionBounds);

View File

@ -92,6 +92,9 @@ namespace CodeWalker.Project
private Dictionary<uint, RelFile> visibleaudiofiles = new Dictionary<uint, RelFile>(); private Dictionary<uint, RelFile> visibleaudiofiles = new Dictionary<uint, RelFile>();
private Dictionary<uint, Archetype> projectarchetypes = new Dictionary<uint, Archetype>();//used to override archetypes in world view private Dictionary<uint, Archetype> projectarchetypes = new Dictionary<uint, Archetype>();//used to override archetypes in world view
private Dictionary<uint, YbnFile> projectybns = new Dictionary<uint, YbnFile>();//used for handling interior ybns
private List<YmapEntityDef> interiorslist = new List<YmapEntityDef>(); //used for handling interiors ybns
private bool ShowProjectItemInProcess = false; private bool ShowProjectItemInProcess = false;
@ -580,6 +583,25 @@ namespace CodeWalker.Project
{ {
ShowEditYtypMloEntSetPanel(promote); ShowEditYtypMloEntSetPanel(promote);
} }
else if (CurrentYbnFile != null)
{
if (CurrentCollisionVertex != null)
{
ShowEditYbnBoundVertexPanel(promote);
}
else if (CurrentCollisionPoly != null)
{
ShowEditYbnBoundPolyPanel(promote);
}
else if (CurrentCollisionBounds != null)
{
ShowEditYbnBoundsPanel(promote);
}
else
{
ShowEditYbnPanel(promote);
}
}
else if (CurrentEntity != null) else if (CurrentEntity != null)
{ {
ShowEditYmapEntityPanel(promote); ShowEditYmapEntityPanel(promote);
@ -604,22 +626,6 @@ namespace CodeWalker.Project
{ {
ShowEditYtypPanel(promote); ShowEditYtypPanel(promote);
} }
else if (CurrentCollisionVertex != null)
{
ShowEditYbnBoundVertexPanel(promote);
}
else if (CurrentCollisionPoly != null)
{
ShowEditYbnBoundPolyPanel(promote);
}
else if (CurrentCollisionBounds != null)
{
ShowEditYbnBoundsPanel(promote);
}
else if (CurrentYbnFile != null)
{
ShowEditYbnPanel(promote);
}
if (CurrentPathNode != null) if (CurrentPathNode != null)
{ {
ShowEditYndNodePanel(promote); ShowEditYndNodePanel(promote);
@ -1507,6 +1513,8 @@ namespace CodeWalker.Project
LoadProjectTree(); LoadProjectTree();
return objs.ToArray(); return objs.ToArray();
} }
else if (sel.CollisionPoly != null) return NewCollisionPoly(sel.CollisionPoly.Type, sel.CollisionPoly, copyPosition, selectNew);
else if (sel.CollisionBounds != null) return NewCollisionBounds(sel.CollisionBounds.Type, sel.CollisionBounds, copyPosition, selectNew);
else if (sel.EntityDef != null) return NewEntity(sel.EntityDef, copyPosition, selectNew); else if (sel.EntityDef != null) return NewEntity(sel.EntityDef, copyPosition, selectNew);
else if (sel.CarGenerator != null) return NewCarGen(sel.CarGenerator, copyPosition, selectNew); else if (sel.CarGenerator != null) return NewCarGen(sel.CarGenerator, copyPosition, selectNew);
else if (sel.PathNode != null) return NewPathNode(sel.PathNode, copyPosition, selectNew); else if (sel.PathNode != null) return NewPathNode(sel.PathNode, copyPosition, selectNew);
@ -1517,8 +1525,6 @@ namespace CodeWalker.Project
else if (sel.ScenarioNode != null) return NewScenarioNode(sel.ScenarioNode, copyPosition, selectNew); else if (sel.ScenarioNode != null) return NewScenarioNode(sel.ScenarioNode, copyPosition, selectNew);
else if (sel.Audio?.AudioZone != null) return NewAudioZone(sel.Audio, copyPosition, selectNew); else if (sel.Audio?.AudioZone != null) return NewAudioZone(sel.Audio, copyPosition, selectNew);
else if (sel.Audio?.AudioEmitter != null) return NewAudioEmitter(sel.Audio, copyPosition, selectNew); else if (sel.Audio?.AudioEmitter != null) return NewAudioEmitter(sel.Audio, copyPosition, selectNew);
else if (sel.CollisionPoly != null) return NewCollisionPoly(sel.CollisionPoly.Type, sel.CollisionPoly, copyPosition, selectNew);
else if (sel.CollisionBounds != null) return NewCollisionBounds(sel.CollisionBounds.Type, sel.CollisionBounds, copyPosition, selectNew);
return null; return null;
} }
public void DeleteObject(MapSelection sel) public void DeleteObject(MapSelection sel)
@ -1531,6 +1537,9 @@ namespace CodeWalker.Project
DeleteObject(sel.MultipleSelectionItems[i]); DeleteObject(sel.MultipleSelectionItems[i]);
} }
} }
else if (sel.CollisionVertex != null) DeleteCollisionVertex();
else if (sel.CollisionPoly != null) DeleteCollisionPoly();
else if (sel.CollisionBounds != null) DeleteCollisionBounds();
else if (sel.EntityDef != null) DeleteEntity(); else if (sel.EntityDef != null) DeleteEntity();
else if (sel.CarGenerator != null) DeleteCarGen(); else if (sel.CarGenerator != null) DeleteCarGen();
else if (sel.PathNode != null) DeletePathNode(); else if (sel.PathNode != null) DeletePathNode();
@ -1541,13 +1550,13 @@ namespace CodeWalker.Project
else if (sel.ScenarioNode != null) DeleteScenarioNode(); else if (sel.ScenarioNode != null) DeleteScenarioNode();
else if (sel.Audio?.AudioZone != null) DeleteAudioZone(); else if (sel.Audio?.AudioZone != null) DeleteAudioZone();
else if (sel.Audio?.AudioEmitter != null) DeleteAudioEmitter(); else if (sel.Audio?.AudioEmitter != null) DeleteAudioEmitter();
else if (sel.CollisionVertex != null) DeleteCollisionVertex();
else if (sel.CollisionPoly != null) DeleteCollisionPoly();
else if (sel.CollisionBounds != null) DeleteCollisionBounds();
} }
private void SetObject(ref MapSelection sel) private void SetObject(ref MapSelection sel)
{ {
if (sel.MultipleSelectionItems != null) { } //todo... if (sel.MultipleSelectionItems != null) { } //todo...
else if (sel.CollisionVertex != null) SetProjectItem(sel.CollisionVertex, false);
else if (sel.CollisionPoly != null) SetProjectItem(sel.CollisionPoly, false);
else if (sel.CollisionBounds != null) SetProjectItem(sel.CollisionBounds, false);
else if (sel.EntityDef != null) SetProjectItem(sel.EntityDef, false); else if (sel.EntityDef != null) SetProjectItem(sel.EntityDef, false);
else if (sel.CarGenerator != null) SetProjectItem(sel.CarGenerator, false); else if (sel.CarGenerator != null) SetProjectItem(sel.CarGenerator, false);
else if (sel.PathNode != null) SetProjectItem(sel.PathNode, false); else if (sel.PathNode != null) SetProjectItem(sel.PathNode, false);
@ -1558,9 +1567,6 @@ namespace CodeWalker.Project
else if (sel.ScenarioNode != null) SetProjectItem(sel.ScenarioNode, false); else if (sel.ScenarioNode != null) SetProjectItem(sel.ScenarioNode, false);
else if (sel.Audio?.AudioZone != null) SetProjectItem(sel.Audio, false); else if (sel.Audio?.AudioZone != null) SetProjectItem(sel.Audio, false);
else if (sel.Audio?.AudioEmitter != null) SetProjectItem(sel.Audio, false); else if (sel.Audio?.AudioEmitter != null) SetProjectItem(sel.Audio, false);
else if (sel.CollisionVertex != null) SetProjectItem(sel.CollisionVertex, false);
else if (sel.CollisionPoly != null) SetProjectItem(sel.CollisionPoly, false);
else if (sel.CollisionBounds != null) SetProjectItem(sel.CollisionBounds, false);
} }
@ -6436,7 +6442,7 @@ namespace CodeWalker.Project
} }
} }
} }
public void GetVisibleYbns(Camera camera, List<YbnFile> ybns) public void GetVisibleYbns(Camera camera, List<YbnFile> ybns, Dictionary<YmapEntityDef, YbnFile> interiors)
{ {
if (hidegtavmap) if (hidegtavmap)
{ {
@ -6458,16 +6464,48 @@ namespace CodeWalker.Project
{ {
var ybn = CurrentProjectFile.YbnFiles[i]; var ybn = CurrentProjectFile.YbnFiles[i];
if (ybn.Loaded) if (ybn.Loaded)
{
if (!visiblemloentities.ContainsKey((ybn.RpfFileEntry != null) ? ybn.RpfFileEntry.ShortNameHash : 0))
{ {
visibleybns[ybn.Name] = ybn; visibleybns[ybn.Name] = ybn;
} }
} }
}
ybns.Clear(); ybns.Clear();
foreach (var ybn in visibleybns.Values) foreach (var ybn in visibleybns.Values)
{ {
ybns.Add(ybn); ybns.Add(ybn);
} }
//messy way to gather the interior ybns!
projectybns.Clear();
for (int i = 0; i < CurrentProjectFile.YbnFiles.Count; i++)
{
var ybn = CurrentProjectFile.YbnFiles[i];
if (ybn.Loaded)
{
projectybns[ybn.RpfFileEntry?.ShortNameHash ?? JenkHash.GenHash(ybn.Name)] = ybn;
}
}
interiorslist.Clear();
interiorslist.AddRange(interiors.Keys);
for (int i = 0; i < interiorslist.Count; i++)
{
var mlo = interiorslist[i];
var hash = mlo._CEntityDef.archetypeName;
if (projectybns.TryGetValue(hash, out YbnFile ybn))
{
if ((ybn != null) && (ybn.Loaded))
{
interiors[mlo] = ybn;
}
}
}
} }
} }
@ -6659,12 +6697,13 @@ namespace CodeWalker.Project
public void GetMouseCollision(Camera camera, ref MapSelection curHit) public void GetMouseCollision(Camera camera, ref MapSelection curHit)
{ {
Ray mray = new Ray(); var mray = new Ray();
mray.Position = camera.MouseRay.Position + camera.Position; mray.Position = camera.MouseRay.Position + camera.Position;
mray.Direction = camera.MouseRay.Direction; mray.Direction = camera.MouseRay.Direction;
var bounds = curHit.CollisionBounds ?? curHit.CollisionPoly?.Owner ?? curHit.CollisionVertex?.Owner; var bounds = curHit.CollisionBounds ?? curHit.CollisionPoly?.Owner ?? curHit.CollisionVertex?.Owner;
var curybn = bounds?.GetRootYbn(); var curybn = bounds?.GetRootYbn();
var eray = mray;
if (hidegtavmap && (curybn != null)) if (hidegtavmap && (curybn != null))
{ {
@ -6688,7 +6727,7 @@ namespace CodeWalker.Project
if (ybn.Bounds != null) if (ybn.Bounds != null)
{ {
var hit = ybn.Bounds.RayIntersect(ref mray); //TODO: interior ybns! var hit = ybn.Bounds.RayIntersect(ref mray);
if (hit.Hit && (hit.HitDist < curHit.HitDist)) if (hit.Hit && (hit.HitDist < curHit.HitDist))
{ {
curHit.UpdateCollisionFromRayHit(ref hit, camera); curHit.UpdateCollisionFromRayHit(ref hit, camera);
@ -6696,6 +6735,31 @@ namespace CodeWalker.Project
} }
} }
} }
for (int i = 0; i < interiorslist.Count; i++)
{
var mlo = interiorslist[i];
var hash = mlo._CEntityDef.archetypeName;
if (projectybns.TryGetValue(hash, out YbnFile ybn))
{
if ((ybn != null) && (ybn.Loaded) && (ybn.Bounds != null))
{
var eorinv = Quaternion.Invert(mlo.Orientation);
eray.Position = eorinv.Multiply(mray.Position - mlo.Position);
eray.Direction = eorinv.Multiply(mray.Direction);
var hit = ybn.Bounds.RayIntersect(ref eray);
if (hit.Hit && (hit.HitDist < curHit.HitDist))
{
hit.HitYbn = ybn;
hit.HitEntity = mlo;
hit.Position = mlo.Orientation.Multiply(hit.Position) + mlo.Position;
hit.Normal = mlo.Orientation.Multiply(hit.Normal);
curHit.UpdateCollisionFromRayHit(ref hit, camera);
}
}
}
}
} }
} }
@ -6753,7 +6817,7 @@ namespace CodeWalker.Project
RelFile audiofile = audiopl?.RelFile; RelFile audiofile = audiopl?.RelFile;
bool showcurrent = false; bool showcurrent = false;
if (YmapExistsInProject(ymap)) if (YmapExistsInProject(ymap) && (ybn == null))
{ {
if (ent != CurrentEntity) if (ent != CurrentEntity)
{ {
@ -6913,14 +6977,6 @@ namespace CodeWalker.Project
{ {
//TODO!! //TODO!!
} }
else if (sel.EntityDef != null)
{
OnWorldEntityModified(sel.EntityDef);
}
else if (sel.CarGenerator != null)
{
OnWorldCarGenModified(sel.CarGenerator);
}
else if (sel.CollisionVertex != null) else if (sel.CollisionVertex != null)
{ {
OnWorldCollisionVertexModified(sel.CollisionVertex); OnWorldCollisionVertexModified(sel.CollisionVertex);
@ -6933,6 +6989,14 @@ namespace CodeWalker.Project
{ {
OnWorldCollisionBoundsModified(sel.CollisionBounds); OnWorldCollisionBoundsModified(sel.CollisionBounds);
} }
else if (sel.EntityDef != null)
{
OnWorldEntityModified(sel.EntityDef);
}
else if (sel.CarGenerator != null)
{
OnWorldCarGenModified(sel.CarGenerator);
}
else if (sel.PathNode != null) else if (sel.PathNode != null)
{ {
OnWorldPathNodeModified(sel.PathNode, sel.PathLink); OnWorldPathNodeModified(sel.PathNode, sel.PathLink);

View File

@ -544,12 +544,14 @@ namespace CodeWalker.Project
public class CollisionPositionUndoStep : UndoStep public class CollisionPositionUndoStep : UndoStep
{ {
public Bounds Bounds { get; set; } public Bounds Bounds { get; set; }
public YmapEntityDef Entity { get; set; }
public Vector3 StartPosition { get; set; } public Vector3 StartPosition { get; set; }
public Vector3 EndPosition { get; set; } public Vector3 EndPosition { get; set; }
public CollisionPositionUndoStep(Bounds bounds, Vector3 startpos, WorldForm wf) public CollisionPositionUndoStep(Bounds bounds, YmapEntityDef ent, Vector3 startpos, WorldForm wf)
{ {
Bounds = bounds; Bounds = bounds;
Entity = ent;
StartPosition = startpos; StartPosition = startpos;
EndPosition = bounds?.Position ?? Vector3.Zero; EndPosition = bounds?.Position ?? Vector3.Zero;
@ -559,9 +561,17 @@ namespace CodeWalker.Project
private void Update(WorldForm wf, ref MapSelection sel, Vector3 p) private void Update(WorldForm wf, ref MapSelection sel, Vector3 p)
{ {
if (Bounds != null) if (Bounds != null)
{
if (Entity != null)
{
Bounds.Position = Quaternion.Invert(Entity.Orientation).Multiply(p - Entity.Position);
}
else
{ {
Bounds.Position = p; Bounds.Position = p;
} }
}
if (Bounds != sel.CollisionBounds) wf.SelectCollisionBounds(Bounds); if (Bounds != sel.CollisionBounds) wf.SelectCollisionBounds(Bounds);
wf.SetWidgetPosition(p); wf.SetWidgetPosition(p);
@ -595,14 +605,20 @@ namespace CodeWalker.Project
public class CollisionRotationUndoStep : UndoStep public class CollisionRotationUndoStep : UndoStep
{ {
public Bounds Bounds { get; set; } public Bounds Bounds { get; set; }
public YmapEntityDef Entity { get; set; }
public Quaternion StartRotation { get; set; } public Quaternion StartRotation { get; set; }
public Quaternion EndRotation { get; set; } public Quaternion EndRotation { get; set; }
public CollisionRotationUndoStep(Bounds bounds, Quaternion startrot, WorldForm wf) public CollisionRotationUndoStep(Bounds bounds, YmapEntityDef ent, Quaternion startrot, WorldForm wf)
{ {
Bounds = bounds; Bounds = bounds;
Entity = ent;
StartRotation = startrot; StartRotation = startrot;
EndRotation = bounds?.Orientation ?? Quaternion.Identity; EndRotation = bounds?.Orientation ?? Quaternion.Identity;
if (ent != null)
{
EndRotation = EndRotation * ent.Orientation;
}
UpdateGraphics(wf); UpdateGraphics(wf);
} }
@ -611,9 +627,16 @@ namespace CodeWalker.Project
private void Update(WorldForm wf, ref MapSelection sel, Quaternion q) private void Update(WorldForm wf, ref MapSelection sel, Quaternion q)
{ {
if (Bounds != null) if (Bounds != null)
{
if (Entity != null)
{
Bounds.Orientation = Quaternion.Invert(Entity.Orientation) * q;
}
else
{ {
Bounds.Orientation = q; Bounds.Orientation = q;
} }
}
if (Bounds != sel.CollisionBounds) wf.SelectCollisionBounds(Bounds); if (Bounds != sel.CollisionBounds) wf.SelectCollisionBounds(Bounds);
wf.SetWidgetRotation(q); wf.SetWidgetRotation(q);
@ -699,12 +722,14 @@ namespace CodeWalker.Project
public class CollisionPolyPositionUndoStep : UndoStep public class CollisionPolyPositionUndoStep : UndoStep
{ {
public BoundPolygon Polygon { get; set; } public BoundPolygon Polygon { get; set; }
public YmapEntityDef Entity { get; set; }
public Vector3 StartPosition { get; set; } public Vector3 StartPosition { get; set; }
public Vector3 EndPosition { get; set; } public Vector3 EndPosition { get; set; }
public CollisionPolyPositionUndoStep(BoundPolygon poly, Vector3 startpos, WorldForm wf) public CollisionPolyPositionUndoStep(BoundPolygon poly, YmapEntityDef ent, Vector3 startpos, WorldForm wf)
{ {
Polygon = poly; Polygon = poly;
Entity = ent;
StartPosition = startpos; StartPosition = startpos;
EndPosition = poly?.Position ?? Vector3.Zero; EndPosition = poly?.Position ?? Vector3.Zero;
@ -714,9 +739,16 @@ namespace CodeWalker.Project
private void Update(WorldForm wf, ref MapSelection sel, Vector3 p) private void Update(WorldForm wf, ref MapSelection sel, Vector3 p)
{ {
if (Polygon != null) if (Polygon != null)
{
if (Entity != null)
{
Polygon.Position = Quaternion.Invert(Entity.Orientation).Multiply(p - Entity.Position);
}
else
{ {
Polygon.Position = p; Polygon.Position = p;
} }
}
if (Polygon != sel.CollisionPoly) wf.SelectCollisionPoly(Polygon); if (Polygon != sel.CollisionPoly) wf.SelectCollisionPoly(Polygon);
wf.SetWidgetPosition(p); wf.SetWidgetPosition(p);
@ -750,14 +782,20 @@ namespace CodeWalker.Project
public class CollisionPolyRotationUndoStep : UndoStep public class CollisionPolyRotationUndoStep : UndoStep
{ {
public BoundPolygon Polygon { get; set; } public BoundPolygon Polygon { get; set; }
public YmapEntityDef Entity { get; set; }
public Quaternion StartRotation { get; set; } public Quaternion StartRotation { get; set; }
public Quaternion EndRotation { get; set; } public Quaternion EndRotation { get; set; }
public CollisionPolyRotationUndoStep(BoundPolygon poly, Quaternion startrot, WorldForm wf) public CollisionPolyRotationUndoStep(BoundPolygon poly, YmapEntityDef ent, Quaternion startrot, WorldForm wf)
{ {
Polygon = poly; Polygon = poly;
Entity = ent;
StartRotation = startrot; StartRotation = startrot;
EndRotation = poly?.Orientation ?? Quaternion.Identity; EndRotation = poly?.Orientation ?? Quaternion.Identity;
if (ent != null)
{
EndRotation = EndRotation * ent.Orientation;
}
UpdateGraphics(wf); UpdateGraphics(wf);
} }
@ -765,9 +803,16 @@ namespace CodeWalker.Project
private void Update(WorldForm wf, ref MapSelection sel, Quaternion q) private void Update(WorldForm wf, ref MapSelection sel, Quaternion q)
{ {
if (Polygon != null) if (Polygon != null)
{
if (Entity != null)
{
Polygon.Orientation = Quaternion.Invert(Entity.Orientation) * q;
}
else
{ {
Polygon.Orientation = q; Polygon.Orientation = q;
} }
}
if (Polygon != sel.CollisionPoly) wf.SelectCollisionPoly(Polygon); if (Polygon != sel.CollisionPoly) wf.SelectCollisionPoly(Polygon);
wf.SetWidgetRotation(q); wf.SetWidgetRotation(q);
@ -853,12 +898,14 @@ namespace CodeWalker.Project
public class CollisionVertexPositionUndoStep : UndoStep public class CollisionVertexPositionUndoStep : UndoStep
{ {
public BoundVertex Vertex { get; set; } public BoundVertex Vertex { get; set; }
public YmapEntityDef Entity { get; set; }
public Vector3 StartPosition { get; set; } public Vector3 StartPosition { get; set; }
public Vector3 EndPosition { get; set; } public Vector3 EndPosition { get; set; }
public CollisionVertexPositionUndoStep(BoundVertex vertex, Vector3 startpos, WorldForm wf) public CollisionVertexPositionUndoStep(BoundVertex vertex, YmapEntityDef ent, Vector3 startpos, WorldForm wf)
{ {
Vertex = vertex; Vertex = vertex;
Entity = ent;
StartPosition = startpos; StartPosition = startpos;
EndPosition = vertex?.Position ?? Vector3.Zero; EndPosition = vertex?.Position ?? Vector3.Zero;
@ -868,9 +915,16 @@ namespace CodeWalker.Project
private void Update(WorldForm wf, ref MapSelection sel, Vector3 p) private void Update(WorldForm wf, ref MapSelection sel, Vector3 p)
{ {
if (Vertex != null) if (Vertex != null)
{
if (Entity != null)
{
Vertex.Position = Quaternion.Invert(Entity.Orientation).Multiply(p - Entity.Position);
}
else
{ {
Vertex.Position = p; Vertex.Position = p;
} }
}
if (Vertex != sel.CollisionVertex) wf.SelectCollisionVertex(Vertex); if (Vertex != sel.CollisionVertex) wf.SelectCollisionVertex(Vertex);
wf.SetWidgetPosition(p); wf.SetWidgetPosition(p);

View File

@ -94,6 +94,7 @@ namespace CodeWalker.Rendering
public bool ShowScriptedYmaps = true; public bool ShowScriptedYmaps = true;
public List<YmapFile> VisibleYmaps = new List<YmapFile>(); public List<YmapFile> VisibleYmaps = new List<YmapFile>();
public List<YmapEntityDef> VisibleMlos = new List<YmapEntityDef>();
public rage__eLodType renderworldMaxLOD = rage__eLodType.LODTYPES_DEPTH_ORPHANHD; public rage__eLodType renderworldMaxLOD = rage__eLodType.LODTYPES_DEPTH_ORPHANHD;
public float renderworldLodDistMult = 1.0f; public float renderworldLodDistMult = 1.0f;
@ -1646,6 +1647,7 @@ namespace CodeWalker.Rendering
renderworldentities.Clear(); renderworldentities.Clear();
renderworldrenderables.Clear(); renderworldrenderables.Clear();
VisibleYmaps.Clear(); VisibleYmaps.Clear();
VisibleMlos.Clear();
ArchetypeRenderables.Clear(); ArchetypeRenderables.Clear();
RequiredParents.Clear(); RequiredParents.Clear();
RenderEntities.Clear(); RenderEntities.Clear();
@ -1680,6 +1682,7 @@ namespace CodeWalker.Rendering
{ {
if (renderinteriors && (ent.MloInstance != null) && !MapViewEnabled) //render Mlo child entities... if (renderinteriors && (ent.MloInstance != null) && !MapViewEnabled) //render Mlo child entities...
{ {
VisibleMlos.Add(ent);
renderworldentities.Add(ent);//collisions rendering needs this renderworldentities.Add(ent);//collisions rendering needs this
RenderWorldAddInteriorEntities(ent); RenderWorldAddInteriorEntities(ent);
} }
@ -2149,17 +2152,6 @@ namespace CodeWalker.Rendering
} }
private void RenderWorldYmapExtras() private void RenderWorldYmapExtras()
{ {
if (renderinteriors && (rendercollisionmeshes || (SelectionMode == MapSelectionMode.Collision)))
{
for (int i = 0; i < renderworldentities.Count; i++)
{
var ent = renderworldentities[i];
if (ent.IsMlo)
{
RenderInteriorCollisionMesh(ent);
}
}
}
if (rendercars) if (rendercars)
{ {
for (int y = 0; y < VisibleYmaps.Count; y++) for (int y = 0; y < VisibleYmaps.Count; y++)
@ -2435,10 +2427,6 @@ namespace CodeWalker.Rendering
RenderArchetype(intarch, intent); RenderArchetype(intarch, intent);
} }
} }
if (rendercollisionmeshes || (SelectionMode == MapSelectionMode.Collision))
{
RenderInteriorCollisionMesh(entity);
}
} }
@ -3225,20 +3213,6 @@ namespace CodeWalker.Rendering
private void RenderInteriorCollisionMesh(YmapEntityDef mlo)
{
//enqueue interior collison meshes for rendering.
if (mlo.Archetype == null) return;
var hash = mlo.Archetype.Hash;
YbnFile ybn = gameFileCache.GetYbn(hash);
if ((ybn != null) && (ybn.Loaded))
{
RenderCollisionMesh(ybn.Bounds, mlo);
}
if (ybn == null)
{ }
}
public void RenderCollisionMesh(Bounds bounds, YmapEntityDef entity) public void RenderCollisionMesh(Bounds bounds, YmapEntityDef entity)
{ {

View File

@ -221,13 +221,27 @@ namespace CodeWalker
public string GetNameString(string defval) public string GetNameString(string defval)
{ {
string name = defval; string name = defval;
var ename = (EntityDef != null) ? EntityDef._CEntityDef.archetypeName.ToString() : string.Empty;
var enamec = ename + ((!string.IsNullOrEmpty(ename)) ? ": " : "");
if (MultipleSelectionItems != null) if (MultipleSelectionItems != null)
{ {
name = "Multiple items"; name = "Multiple items";
} }
else if (CollisionVertex != null)
{
name = enamec + "Vertex " + CollisionVertex.Index.ToString() + ((CollisionBounds != null) ? (": " + CollisionBounds.GetName()) : string.Empty);
}
else if (CollisionPoly != null)
{
name = enamec + "Poly " + CollisionPoly.Index.ToString() + ((CollisionBounds != null) ? (": " + CollisionBounds.GetName()) : string.Empty);
}
else if (CollisionBounds != null)
{
name = enamec + CollisionBounds.GetName();
}
else if (EntityDef != null) else if (EntityDef != null)
{ {
name = EntityDef._CEntityDef.archetypeName.ToString(); name = ename;
} }
else if (Archetype != null) else if (Archetype != null)
{ {
@ -257,18 +271,6 @@ namespace CodeWalker
{ {
name = "OccludeModel " + (OccludeModel.Ymap?.Name ?? "") + ": " + OccludeModel.Index.ToString(); name = "OccludeModel " + (OccludeModel.Ymap?.Name ?? "") + ": " + OccludeModel.Index.ToString();
} }
else if (CollisionVertex != null)
{
name = "Vertex " + CollisionVertex.Index.ToString() + ((CollisionBounds != null) ? (": " + CollisionBounds.GetName()) : string.Empty);
}
else if (CollisionPoly != null)
{
name = "Poly " + CollisionPoly.Index.ToString() + ((CollisionBounds != null) ? (": " + CollisionBounds.GetName()) : string.Empty);
}
else if (CollisionBounds != null)
{
name = CollisionBounds.GetName();
}
else if (WaterQuad != null) else if (WaterQuad != null)
{ {
name = "WaterQuad " + WaterQuad.ToString(); name = "WaterQuad " + WaterQuad.ToString();
@ -334,6 +336,7 @@ namespace CodeWalker
if (CarGenerator != null) return true; if (CarGenerator != null) return true;
if (CollisionBounds != null) return true; if (CollisionBounds != null) return true;
if (CollisionPoly != null) return true; if (CollisionPoly != null) return true;
if (CollisionVertex != null) return true;
if (PathNode != null) return true; if (PathNode != null) return true;
//if (NavPoly != null) return true; //if (NavPoly != null) return true;
if (NavPoint != null) return true; if (NavPoint != null) return true;
@ -354,6 +357,31 @@ namespace CodeWalker
case WidgetMode.Scale: return new MultiScaleUndoStep(this, startScale, wf); case WidgetMode.Scale: return new MultiScaleUndoStep(this, startScale, wf);
} }
} }
else if (CollisionVertex != null)
{
switch (mode)
{
case WidgetMode.Position: return new CollisionVertexPositionUndoStep(CollisionVertex, EntityDef, startPos, wf);
}
}
else if (CollisionPoly != null)
{
switch (mode)
{
case WidgetMode.Position: return new CollisionPolyPositionUndoStep(CollisionPoly, EntityDef, startPos, wf);
case WidgetMode.Rotation: return new CollisionPolyRotationUndoStep(CollisionPoly, EntityDef, startRot, wf);
case WidgetMode.Scale: return new CollisionPolyScaleUndoStep(CollisionPoly, startScale, wf);
}
}
else if (CollisionBounds != null)
{
switch (mode)
{
case WidgetMode.Position: return new CollisionPositionUndoStep(CollisionBounds, EntityDef, startPos, wf);
case WidgetMode.Rotation: return new CollisionRotationUndoStep(CollisionBounds, EntityDef, startRot, wf);
case WidgetMode.Scale: return new CollisionScaleUndoStep(CollisionBounds, startScale, wf);
}
}
else if (EntityDef != null) else if (EntityDef != null)
{ {
if (editPivot) if (editPivot)
@ -383,31 +411,6 @@ namespace CodeWalker
case WidgetMode.Scale: return new CarGenScaleUndoStep(CarGenerator, startScale); case WidgetMode.Scale: return new CarGenScaleUndoStep(CarGenerator, startScale);
} }
} }
else if (CollisionVertex != null)
{
switch (mode)
{
case WidgetMode.Position: return new CollisionVertexPositionUndoStep(CollisionVertex, startPos, wf);
}
}
else if (CollisionPoly != null)
{
switch (mode)
{
case WidgetMode.Position: return new CollisionPolyPositionUndoStep(CollisionPoly, startPos, wf);
case WidgetMode.Rotation: return new CollisionPolyRotationUndoStep(CollisionPoly, startRot, wf);
case WidgetMode.Scale: return new CollisionPolyScaleUndoStep(CollisionPoly, startScale, wf);
}
}
else if (CollisionBounds != null)
{
switch (mode)
{
case WidgetMode.Position: return new CollisionPositionUndoStep(CollisionBounds, startPos, wf);
case WidgetMode.Rotation: return new CollisionRotationUndoStep(CollisionBounds, startRot, wf);
case WidgetMode.Scale: return new CollisionScaleUndoStep(CollisionBounds, startScale, wf);
}
}
else if (PathNode != null) else if (PathNode != null)
{ {
switch (mode) switch (mode)
@ -530,6 +533,21 @@ namespace CodeWalker
{ {
return MultipleSelectionCenter; return MultipleSelectionCenter;
} }
else if (CollisionVertex != null)
{
if (EntityDef != null) return EntityDef.Position + EntityDef.Orientation.Multiply(CollisionVertex.Position);
return CollisionVertex.Position;
}
else if (CollisionPoly != null)
{
if (EntityDef != null) return EntityDef.Position + EntityDef.Orientation.Multiply(CollisionPoly.Position);
return CollisionPoly.Position;
}
else if (CollisionBounds != null)
{
if (EntityDef != null) return EntityDef.Position + EntityDef.Orientation.Multiply(CollisionBounds.Position);
return CollisionBounds.Position;
}
else if (EntityDef != null) else if (EntityDef != null)
{ {
return EntityDef.WidgetPosition; return EntityDef.WidgetPosition;
@ -538,18 +556,6 @@ namespace CodeWalker
{ {
return CarGenerator.Position; return CarGenerator.Position;
} }
else if (CollisionVertex != null)
{
return CollisionVertex.Position;
}
else if (CollisionPoly != null)
{
return CollisionPoly.Position;
}
else if (CollisionBounds != null)
{
return CollisionBounds.Position;
}
else if (NavPoly != null) else if (NavPoly != null)
{ {
return NavPoly.Position; return NavPoly.Position;
@ -589,6 +595,21 @@ namespace CodeWalker
{ {
return MultipleSelectionRotation; return MultipleSelectionRotation;
} }
else if (CollisionVertex != null)
{
if (EntityDef != null) return EntityDef.Orientation;
return Quaternion.Identity;
}
else if (CollisionPoly != null)
{
if (EntityDef != null) return CollisionPoly.Orientation * EntityDef.Orientation;
return CollisionPoly.Orientation;
}
else if (CollisionBounds != null)
{
if (EntityDef != null) return CollisionBounds.Orientation * EntityDef.Orientation;
return CollisionBounds.Orientation;
}
else if (EntityDef != null) else if (EntityDef != null)
{ {
return EntityDef.WidgetOrientation; return EntityDef.WidgetOrientation;
@ -597,18 +618,6 @@ namespace CodeWalker
{ {
return CarGenerator.Orientation; return CarGenerator.Orientation;
} }
else if (CollisionVertex != null)
{
return Quaternion.Identity;
}
else if (CollisionPoly != null)
{
return CollisionPoly.Orientation;
}
else if (CollisionBounds != null)
{
return CollisionBounds.Orientation;
}
else if (NavPoly != null) else if (NavPoly != null)
{ {
return Quaternion.Identity; return Quaternion.Identity;
@ -648,14 +657,6 @@ namespace CodeWalker
{ {
return WidgetAxis.XYZ; return WidgetAxis.XYZ;
} }
else if (EntityDef != null)
{
return WidgetAxis.XYZ;
}
else if (CarGenerator != null)
{
return WidgetAxis.Z;
}
else if (CollisionVertex != null) else if (CollisionVertex != null)
{ {
return WidgetAxis.None; return WidgetAxis.None;
@ -668,6 +669,14 @@ namespace CodeWalker
{ {
return WidgetAxis.XYZ; return WidgetAxis.XYZ;
} }
else if (EntityDef != null)
{
return WidgetAxis.XYZ;
}
else if (CarGenerator != null)
{
return WidgetAxis.Z;
}
else if (NavPoly != null) else if (NavPoly != null)
{ {
return WidgetAxis.XYZ; return WidgetAxis.XYZ;
@ -707,14 +716,6 @@ namespace CodeWalker
{ {
return MultipleSelectionScale; return MultipleSelectionScale;
} }
else if (EntityDef != null)
{
return EntityDef.Scale;
}
else if (CarGenerator != null)
{
return new Vector3(CarGenerator.CCarGen.perpendicularLength);
}
else if (CollisionVertex != null) else if (CollisionVertex != null)
{ {
return Vector3.One; return Vector3.One;
@ -727,6 +728,14 @@ namespace CodeWalker
{ {
return CollisionBounds.Scale; return CollisionBounds.Scale;
} }
else if (EntityDef != null)
{
return EntityDef.Scale;
}
else if (CarGenerator != null)
{
return new Vector3(CarGenerator.CCarGen.perpendicularLength);
}
else if (NavPoly != null) else if (NavPoly != null)
{ {
return Vector3.One; return Vector3.One;
@ -766,7 +775,7 @@ namespace CodeWalker
{ {
for (int i = 0; i < MultipleSelectionItems.Length; i++) for (int i = 0; i < MultipleSelectionItems.Length; i++)
{ {
if (MultipleSelectionItems[i].EntityDef != null) return true; if ((MultipleSelectionItems[i].EntityDef != null) && (MultipleSelectionItems[i].CollisionBounds == null)) return true;
} }
return false; return false;
} }
@ -794,6 +803,9 @@ namespace CodeWalker
} }
return false; return false;
} }
else if (CollisionVertex != null) return false;//can't copy just a vertex..
else if (CollisionPoly != null) return true;
else if (CollisionBounds != null) return true;
else if (EntityDef != null) return true; else if (EntityDef != null) return true;
else if (CarGenerator != null) return true; else if (CarGenerator != null) return true;
else if (PathNode != null) return true; else if (PathNode != null) return true;
@ -804,9 +816,6 @@ namespace CodeWalker
else if (ScenarioNode != null) return true; else if (ScenarioNode != null) return true;
else if (Audio?.AudioZone != null) return true; else if (Audio?.AudioZone != null) return true;
else if (Audio?.AudioEmitter != null) return true; else if (Audio?.AudioEmitter != null) return true;
else if (CollisionVertex != null) return false;//can't copy just a vertex..
else if (CollisionPoly != null) return true;
else if (CollisionBounds != null) return true;
return false; return false;
} }
} }
@ -856,6 +865,7 @@ namespace CodeWalker
{ {
var dpos = newpos - MultipleSelectionCenter;// oldpos; var dpos = newpos - MultipleSelectionCenter;// oldpos;
if (dpos == Vector3.Zero) return; //nothing moved.. (probably due to snap) if (dpos == Vector3.Zero) return; //nothing moved.. (probably due to snap)
YmapEntityDef ent = null;//hack to use an entity for multple selections... buggy if entities mismatch!!!
for (int i = 0; i < MultipleSelectionItems.Length; i++) for (int i = 0; i < MultipleSelectionItems.Length; i++)
{ {
if (MultipleSelectionItems[i].CollisionPoly == null)//skip polys, they use gathered verts if (MultipleSelectionItems[i].CollisionPoly == null)//skip polys, they use gathered verts
@ -863,18 +873,36 @@ namespace CodeWalker
var refpos = MultipleSelectionItems[i].WidgetPosition; var refpos = MultipleSelectionItems[i].WidgetPosition;
MultipleSelectionItems[i].SetPosition(refpos + dpos, false); MultipleSelectionItems[i].SetPosition(refpos + dpos, false);
} }
ent = MultipleSelectionItems[i].EntityDef ?? ent;
} }
if (ent != null) dpos = Quaternion.Invert(ent.Orientation).Multiply(dpos);
if (GatheredCollisionVerts != null) if (GatheredCollisionVerts != null)
{ {
for (int i = 0; i < GatheredCollisionVerts.Length; i++) for (int i = 0; i < GatheredCollisionVerts.Length; i++)
{ {
var refpos = GatheredCollisionVerts[i].Position; var refpos = GatheredCollisionVerts[i].Position;
GatheredCollisionVerts[i].Position = refpos + dpos; var vnewpos = refpos + dpos;
GatheredCollisionVerts[i].Position = vnewpos;
} }
} }
MultipleSelectionCenter = newpos; MultipleSelectionCenter = newpos;
} }
} }
else if (CollisionVertex != null)
{
if (EntityDef != null) newpos = Quaternion.Invert(EntityDef.Orientation).Multiply(newpos - EntityDef.Position);
CollisionVertex.Position = newpos;
}
else if (CollisionPoly != null)
{
if (EntityDef != null) newpos = Quaternion.Invert(EntityDef.Orientation).Multiply(newpos - EntityDef.Position);
CollisionPoly.Position = newpos;
}
else if (CollisionBounds != null)
{
if (EntityDef != null) newpos = Quaternion.Invert(EntityDef.Orientation).Multiply(newpos - EntityDef.Position);
CollisionBounds.Position = newpos;
}
else if (EntityDef != null) else if (EntityDef != null)
{ {
if (editPivot) if (editPivot)
@ -894,18 +922,6 @@ namespace CodeWalker
{ {
PathNode.SetPosition(newpos); PathNode.SetPosition(newpos);
} }
else if (CollisionVertex != null)
{
CollisionVertex.Position = newpos;
}
else if (CollisionPoly != null)
{
CollisionPoly.Position = newpos;
}
else if (CollisionBounds != null)
{
CollisionBounds.Position = newpos;
}
else if (NavPoly != null) else if (NavPoly != null)
{ {
NavPoly.SetPosition(newpos); NavPoly.SetPosition(newpos);
@ -944,6 +960,7 @@ namespace CodeWalker
var cen = MultipleSelectionCenter; var cen = MultipleSelectionCenter;
var orinv = Quaternion.Invert(MultipleSelectionRotation); var orinv = Quaternion.Invert(MultipleSelectionRotation);
var trans = newrot * orinv; var trans = newrot * orinv;
YmapEntityDef ent = null;//hack to use an entity for multple selections... buggy if entities mismatch!!!
for (int i = 0; i < MultipleSelectionItems.Length; i++) for (int i = 0; i < MultipleSelectionItems.Length; i++)
{ {
if (MultipleSelectionItems[i].CollisionPoly == null)//skip polys, they use gathered verts if (MultipleSelectionItems[i].CollisionPoly == null)//skip polys, they use gathered verts
@ -956,7 +973,9 @@ namespace CodeWalker
MultipleSelectionItems[i].SetPosition(newpos, false); MultipleSelectionItems[i].SetPosition(newpos, false);
MultipleSelectionItems[i].SetRotation(newori, false); MultipleSelectionItems[i].SetRotation(newori, false);
} }
ent = MultipleSelectionItems[i].EntityDef ?? ent;
} }
var eorinv = (ent != null) ? Quaternion.Invert(ent.Orientation) : Quaternion.Identity;
if (GatheredCollisionVerts != null) if (GatheredCollisionVerts != null)
{ {
for (int i = 0; i < GatheredCollisionVerts.Length; i++) for (int i = 0; i < GatheredCollisionVerts.Length; i++)
@ -964,12 +983,32 @@ namespace CodeWalker
var refpos = GatheredCollisionVerts[i].Position; var refpos = GatheredCollisionVerts[i].Position;
var relpos = refpos - cen; var relpos = refpos - cen;
var newpos = trans.Multiply(relpos) + cen; var newpos = trans.Multiply(relpos) + cen;
if (ent != null)
{
refpos = ent.Position + ent.Orientation.Multiply(refpos);
relpos = refpos - cen;
newpos = eorinv.Multiply(trans.Multiply(relpos) + cen - ent.Position);
}
GatheredCollisionVerts[i].Position = newpos; GatheredCollisionVerts[i].Position = newpos;
} }
} }
MultipleSelectionRotation = newrot; MultipleSelectionRotation = newrot;
} }
} }
else if (CollisionVertex != null)
{
//do nothing, but stop any poly from being rotated also
}
else if (CollisionPoly != null)
{
if (EntityDef != null) newrot = Quaternion.Normalize(Quaternion.Invert(EntityDef.Orientation) * newrot);
CollisionPoly.Orientation = newrot;
}
else if (CollisionBounds != null)
{
if (EntityDef != null) newrot = Quaternion.Normalize(Quaternion.Invert(EntityDef.Orientation) * newrot);
CollisionBounds.Orientation = newrot;
}
else if (EntityDef != null) else if (EntityDef != null)
{ {
if (editPivot) if (editPivot)
@ -985,18 +1024,6 @@ namespace CodeWalker
{ {
CarGenerator.SetOrientation(newrot); CarGenerator.SetOrientation(newrot);
} }
else if (CollisionVertex != null)
{
//do nothing, but stop any poly from being rotated also
}
else if (CollisionPoly != null)
{
CollisionPoly.Orientation = newrot;
}
else if (CollisionBounds != null)
{
CollisionBounds.Orientation = newrot;
}
else if (ScenarioNode != null) else if (ScenarioNode != null)
{ {
ScenarioNode.SetOrientation(newrot); ScenarioNode.SetOrientation(newrot);
@ -1027,6 +1054,7 @@ namespace CodeWalker
var ori = MultipleSelectionRotation; var ori = MultipleSelectionRotation;
var orinv = Quaternion.Invert(ori); var orinv = Quaternion.Invert(ori);
var rsca = newscale / MultipleSelectionScale; var rsca = newscale / MultipleSelectionScale;
YmapEntityDef ent = null;//hack to use an entity for multple selections... buggy if entities mismatch!!!
for (int i = 0; i < MultipleSelectionItems.Length; i++) for (int i = 0; i < MultipleSelectionItems.Length; i++)
{ {
if (MultipleSelectionItems[i].CollisionPoly == null)//skip polys, they use gathered verts if (MultipleSelectionItems[i].CollisionPoly == null)//skip polys, they use gathered verts
@ -1037,7 +1065,9 @@ namespace CodeWalker
MultipleSelectionItems[i].SetPosition(newpos, false); MultipleSelectionItems[i].SetPosition(newpos, false);
MultipleSelectionItems[i].SetScale(newscale, false); MultipleSelectionItems[i].SetScale(newscale, false);
} }
ent = MultipleSelectionItems[i].EntityDef ?? ent;
} }
var eorinv = (ent != null) ? Quaternion.Invert(ent.Orientation) : Quaternion.Identity;
if (GatheredCollisionVerts != null) if (GatheredCollisionVerts != null)
{ {
for (int i = 0; i < GatheredCollisionVerts.Length; i++) for (int i = 0; i < GatheredCollisionVerts.Length; i++)
@ -1045,21 +1075,19 @@ namespace CodeWalker
var refpos = GatheredCollisionVerts[i].Position; var refpos = GatheredCollisionVerts[i].Position;
var relpos = refpos - cen; var relpos = refpos - cen;
var newpos = ori.Multiply(orinv.Multiply(relpos) * rsca) + cen; var newpos = ori.Multiply(orinv.Multiply(relpos) * rsca) + cen;
if (ent != null)
{
refpos = ent.Position + ent.Orientation.Multiply(refpos);
relpos = refpos - cen;
newpos = ori.Multiply(orinv.Multiply(relpos) * rsca) + cen;
newpos = eorinv.Multiply(newpos - ent.Position);
}
GatheredCollisionVerts[i].Position = newpos; GatheredCollisionVerts[i].Position = newpos;
} }
} }
MultipleSelectionScale = newscale; MultipleSelectionScale = newscale;
} }
} }
else if (EntityDef != null)
{
EntityDef.SetScale(newscale);
}
else if (CarGenerator != null)
{
CarGenerator.SetScale(newscale);
AABB = new BoundingBox(CarGenerator.BBMin, CarGenerator.BBMax);
}
else if (CollisionVertex != null) else if (CollisionVertex != null)
{ {
//do nothing, but stop any poly from being scaled also //do nothing, but stop any poly from being scaled also
@ -1072,6 +1100,15 @@ namespace CodeWalker
{ {
CollisionBounds.Scale = newscale; CollisionBounds.Scale = newscale;
} }
else if (EntityDef != null)
{
EntityDef.SetScale(newscale);
}
else if (CarGenerator != null)
{
CarGenerator.SetScale(newscale);
AABB = new BoundingBox(CarGenerator.BBMin, CarGenerator.BBMax);
}
} }

View File

@ -110,6 +110,7 @@ namespace CodeWalker
bool rendercollisionmeshes = Settings.Default.ShowCollisionMeshes; bool rendercollisionmeshes = Settings.Default.ShowCollisionMeshes;
List<BoundsStoreItem> collisionitems = new List<BoundsStoreItem>(); List<BoundsStoreItem> collisionitems = new List<BoundsStoreItem>();
List<YbnFile> collisionybns = new List<YbnFile>(); List<YbnFile> collisionybns = new List<YbnFile>();
Dictionary<YmapEntityDef, YbnFile> collisioninteriors = new Dictionary<YmapEntityDef, YbnFile>();
int collisionmeshrange = Settings.Default.CollisionMeshRange; int collisionmeshrange = Settings.Default.CollisionMeshRange;
bool[] collisionmeshlayers = { true, true, true }; bool[] collisionmeshlayers = { true, true, true };
@ -740,9 +741,22 @@ namespace CodeWalker
} }
} }
collisioninteriors.Clear();
foreach (var mlo in Renderer.VisibleMlos)
{
if (mlo.Archetype == null) return;
var hash = mlo.Archetype.Hash;
YbnFile ybn = gameFileCache.GetYbn(hash);
if ((ybn != null) && (ybn.Loaded))
{
collisioninteriors[mlo] = ybn;
}
}
if (ProjectForm != null) if (ProjectForm != null)
{ {
ProjectForm.GetVisibleYbns(camera, collisionybns); ProjectForm.GetVisibleYbns(camera, collisionybns, collisioninteriors);
} }
foreach (var ybn in collisionybns) foreach (var ybn in collisionybns)
@ -753,6 +767,14 @@ namespace CodeWalker
} }
} }
foreach (var kvp in collisioninteriors)
{
if ((kvp.Value != null) && (kvp.Value.Loaded))
{
Renderer.RenderCollisionMesh(kvp.Value.Bounds, kvp.Key);
}
}
} }
private void RenderWorldWaterQuads() private void RenderWorldWaterQuads()
@ -2214,8 +2236,6 @@ namespace CodeWalker
ProjectForm.GetMouseCollision(camera, ref CurMouseHit); ProjectForm.GetMouseCollision(camera, ref CurMouseHit);
} }
} }
private void UpdateMouseHits(DrawableBase drawable, Archetype arche, YmapEntityDef entity) private void UpdateMouseHits(DrawableBase drawable, Archetype arche, YmapEntityDef entity)
@ -3227,13 +3247,13 @@ namespace CodeWalker
ProjectForm.OnWorldSelectionChanged(SelectedItem); ProjectForm.OnWorldSelectionChanged(SelectedItem);
} }
} }
else if (obj is Bounds bounds) SelectCollisionBounds(bounds, addSelection);
else if (obj is BoundPolygon cpoly) SelectCollisionPoly(cpoly, addSelection);
else if (obj is BoundVertex cvert) SelectCollisionVertex(cvert, addSelection);
else if (obj is YmapEntityDef ent) SelectEntity(ent, addSelection); else if (obj is YmapEntityDef ent) SelectEntity(ent, addSelection);
else if (obj is YmapCarGen cargen) SelectCarGen(cargen, addSelection); else if (obj is YmapCarGen cargen) SelectCarGen(cargen, addSelection);
else if (obj is YmapGrassInstanceBatch grass) SelectGrassBatch(grass, addSelection); else if (obj is YmapGrassInstanceBatch grass) SelectGrassBatch(grass, addSelection);
else if (obj is MCMloRoomDef room) SelectMloRoom(room, null, addSelection);//how to get instance? else if (obj is MCMloRoomDef room) SelectMloRoom(room, null, addSelection);//how to get instance?
else if (obj is Bounds bounds) SelectCollisionBounds(bounds, addSelection);
else if (obj is BoundPolygon cpoly) SelectCollisionPoly(cpoly, addSelection);
else if (obj is BoundVertex cvert) SelectCollisionVertex(cvert, addSelection);
else if (obj is YnvPoly npoly) SelectNavPoly(npoly, addSelection); else if (obj is YnvPoly npoly) SelectNavPoly(npoly, addSelection);
else if (obj is YnvPoint npoint) SelectNavPoint(npoint, addSelection); else if (obj is YnvPoint npoint) SelectNavPoint(npoint, addSelection);
else if (obj is YnvPortal nportal) SelectNavPortal(nportal, addSelection); else if (obj is YnvPortal nportal) SelectNavPortal(nportal, addSelection);
@ -5158,19 +5178,22 @@ namespace CodeWalker
} }
else else
{ {
DeleteItem(ref SelectedItem); DeleteItem(SelectedItem);
SelectItem(null); SelectItem(null);
} }
} }
private void DeleteItem(ref MapSelection item) private void DeleteItem(MapSelection item)
{ {
if (item.MultipleSelectionItems != null) if (item.MultipleSelectionItems != null)
{ {
for (int i = 0; i < item.MultipleSelectionItems.Length; i++) for (int i = 0; i < item.MultipleSelectionItems.Length; i++)
{ {
DeleteItem(ref item.MultipleSelectionItems[i]); DeleteItem(item.MultipleSelectionItems[i]);
} }
} }
else if (item.CollisionVertex != null) DeleteCollisionVertex(item.CollisionVertex);
else if (item.CollisionPoly != null) DeleteCollisionPoly(item.CollisionPoly);
else if (item.CollisionBounds != null) DeleteCollisionBounds(item.CollisionBounds);
else if (item.EntityDef != null) DeleteEntity(item.EntityDef); else if (item.EntityDef != null) DeleteEntity(item.EntityDef);
else if (item.CarGenerator != null) DeleteCarGen(item.CarGenerator); else if (item.CarGenerator != null) DeleteCarGen(item.CarGenerator);
else if (item.PathNode != null) DeletePathNode(item.PathNode); else if (item.PathNode != null) DeletePathNode(item.PathNode);
@ -5181,9 +5204,6 @@ namespace CodeWalker
else if (item.ScenarioNode != null) DeleteScenarioNode(item.ScenarioNode); else if (item.ScenarioNode != null) DeleteScenarioNode(item.ScenarioNode);
else if (item.Audio?.AudioZone != null) DeleteAudioZone(item.Audio); else if (item.Audio?.AudioZone != null) DeleteAudioZone(item.Audio);
else if (item.Audio?.AudioEmitter != null) DeleteAudioEmitter(item.Audio); else if (item.Audio?.AudioEmitter != null) DeleteAudioEmitter(item.Audio);
else if (item.CollisionVertex != null) DeleteCollisionVertex(item.CollisionVertex);
else if (item.CollisionPoly != null) DeleteCollisionPoly(item.CollisionPoly);
else if (item.CollisionBounds != null) DeleteCollisionBounds(item.CollisionBounds);
} }
private void DeleteEntity(YmapEntityDef ent) private void DeleteEntity(YmapEntityDef ent)
{ {