From a68523b2efeb977aaf026841a41cec1ae9eabd11 Mon Sep 17 00:00:00 2001 From: dexyfex Date: Wed, 7 Mar 2018 13:12:20 +1100 Subject: [PATCH] Improved interior info display and XML conversion --- CodeWalker.Core/GameFiles/GameFileCache.cs | 52 ++++++ .../GameFiles/MetaTypes/MetaNames.cs | 2 +- .../GameFiles/MetaTypes/MetaTypes.cs | 27 ++- Todo.txt | 1 + WorldForm.Designer.cs | 168 +++++++++--------- WorldForm.cs | 55 +++++- WorldForm.resx | 104 +++++------ 7 files changed, 269 insertions(+), 140 deletions(-) diff --git a/CodeWalker.Core/GameFiles/GameFileCache.cs b/CodeWalker.Core/GameFiles/GameFileCache.cs index 5e9079b..b97d2f7 100644 --- a/CodeWalker.Core/GameFiles/GameFileCache.cs +++ b/CodeWalker.Core/GameFiles/GameFileCache.cs @@ -1828,9 +1828,61 @@ namespace CodeWalker.GameFiles if (iarch == null) { } //can't find archetype - des stuff eg {des_prologue_door} } + + + //update archetype room AABB's.. bad to have this here? where else to put it? + var mloa = arch as MloArchetype; + if (mloa != null) + { + Vector3[] c = new Vector3[8]; + var rooms = mloa.rooms; + if (rooms != null) + { + for (int j = 0; j < rooms.Length; j++) + { + var room = rooms[j]; + if ((room.AttachedObjects == null) || (room.AttachedObjects.Length == 0)) continue; + Vector3 min = new Vector3(float.MaxValue); + Vector3 max = new Vector3(float.MinValue); + for (int k = 0; k < room.AttachedObjects.Length; k++) + { + var objid = room.AttachedObjects[k]; + if (objid < entities.Length) + { + var rooment = entities[objid]; + if ((rooment != null) && (rooment.Archetype != null)) + { + var earch = rooment.Archetype; + var pos = rooment._CEntityDef.position; + var ori = rooment.Orientation; + Vector3 abmin = earch.BBMin * rooment.Scale; //entity box + Vector3 abmax = earch.BBMax * rooment.Scale; + c[0] = abmin; + c[1] = new Vector3(abmin.X, abmin.Y, abmax.Z); + c[2] = new Vector3(abmin.X, abmax.Y, abmin.Z); + c[3] = new Vector3(abmin.X, abmax.Y, abmax.Z); + c[4] = new Vector3(abmax.X, abmin.Y, abmin.Z); + c[5] = new Vector3(abmax.X, abmin.Y, abmax.Z); + c[6] = new Vector3(abmax.X, abmax.Y, abmin.Z); + c[7] = abmax; + for (int n = 0; n < 8; n++) + { + Vector3 corn = ori.Multiply(c[n]) + pos; + min = Vector3.Min(min, corn); + max = Vector3.Max(max, corn); + } + } + } + } + room.BBMin_CW = min; + room.BBMax_CW = max; + } + } + } } } + } } if (file.GrassInstanceBatches != null) diff --git a/CodeWalker.Core/GameFiles/MetaTypes/MetaNames.cs b/CodeWalker.Core/GameFiles/MetaTypes/MetaNames.cs index a5fbf36..73a63b5 100644 --- a/CodeWalker.Core/GameFiles/MetaTypes/MetaNames.cs +++ b/CodeWalker.Core/GameFiles/MetaTypes/MetaNames.cs @@ -3441,7 +3441,7 @@ namespace CodeWalker.GameFiles timecycleName = 2724323497, secondaryTimecycleName = 3255324828, portalCount = 1105339827, - //exteriorVisibiltyDepth = 552849982, //not correct = spelling error? + exteriorVisibiltyDepth = 552849982, //not correct = spelling error? attachedObjects = 2382704940, roomFrom = 4101034749, roomTo = 2607060513, diff --git a/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs b/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs index 746bc10..3013d08 100644 --- a/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs +++ b/CodeWalker.Core/GameFiles/MetaTypes/MetaTypes.cs @@ -840,7 +840,7 @@ namespace CodeWalker.GameFiles new MetaStructureEntryInfo_s(MetaName.flags, 76, MetaStructureEntryDataType.UnsignedInt, 0, 0, 0), new MetaStructureEntryInfo_s(MetaName.portalCount, 80, MetaStructureEntryDataType.UnsignedInt, 0, 0, 0), new MetaStructureEntryInfo_s(MetaName.floorId, 84, MetaStructureEntryDataType.SignedInt, 0, 0, 0), - new MetaStructureEntryInfo_s((MetaName)552849982, 88, MetaStructureEntryDataType.SignedInt, 0, 0, 0), + new MetaStructureEntryInfo_s(MetaName.exteriorVisibiltyDepth, 88, MetaStructureEntryDataType.SignedInt, 0, 0, 0), new MetaStructureEntryInfo_s(MetaName.ARRAYINFO, 0, MetaStructureEntryDataType.UnsignedInt, 0, 0, 0), new MetaStructureEntryInfo_s(MetaName.attachedObjects, 96, MetaStructureEntryDataType.Array, 0, 10, 0) ); @@ -2411,7 +2411,7 @@ namespace CodeWalker.GameFiles public uint flags { get; set; } //76 76: UnsignedInt: 0: flags public uint portalCount { get; set; } //80 80: UnsignedInt: 0: portalCount//1105339827 public int floorId { get; set; } //84 84: SignedInt: 0: floorId//2187650609 - public int Unk_552849982 { get; set; } //88 88: SignedInt: 0: exteriorVisibiltyDepth//552849982 + public int exteriorVisibiltyDepth { get; set; } //88 88: SignedInt: 0: exteriorVisibiltyDepth//552849982 public uint Unused6 { get; set; }//92 public Array_uint attachedObjects { get; set; } //96 96: Array: 0: attachedObjects//2382704940 {0: UnsignedInt: 0: 256} } @@ -2422,6 +2422,14 @@ namespace CodeWalker.GameFiles public string RoomName { get; set; } public uint[] AttachedObjects { get; set; } + public Vector3 BBCenter { get { return (_Data.bbMax + _Data.bbMin) * 0.5f; } } + public Vector3 BBSize { get { return (_Data.bbMax - _Data.bbMin); } } + public Vector3 BBMin { get { return (_Data.bbMin); } } + public Vector3 BBMax { get { return (_Data.bbMax); } } + public Vector3 BBMin_CW { get; set; } + public Vector3 BBMax_CW { get; set; } + + public MCMloRoomDef() { } public MCMloRoomDef(Meta meta, CMloRoomDef data) { @@ -2495,6 +2503,21 @@ namespace CodeWalker.GameFiles public Vector4[] Corners { get; set; } public uint[] AttachedObjects { get; set; } + public Vector3 Center + { + get + { + if ((Corners == null)||(Corners.Length==0)) return Vector3.Zero; + var v = Vector3.Zero; + for (int i = 0; i < Corners.Length; i++) + { + v += Corners[i].XYZ(); + } + v *= (1.0f / Corners.Length); + return v; + } + } + public MCMloPortalDef() { } public MCMloPortalDef(Meta meta, CMloPortalDef data) { diff --git a/Todo.txt b/Todo.txt index 6174ba6..226e7e1 100644 --- a/Todo.txt +++ b/Todo.txt @@ -101,6 +101,7 @@ done: [v.29] +Improved selected MLO instance display - portals, limbo room New Project Window RPF Explorer drag & drop Show vehicle wheels diff --git a/WorldForm.Designer.cs b/WorldForm.Designer.cs index 18ece1b..b64100a 100644 --- a/WorldForm.Designer.cs +++ b/WorldForm.Designer.cs @@ -145,6 +145,8 @@ namespace CodeWalker this.WaitForChildrenCheckBox = new System.Windows.Forms.CheckBox(); this.label14 = new System.Windows.Forms.Label(); this.tabPage9 = new System.Windows.Forms.TabPage(); + this.SnapGridSizeUpDown = new System.Windows.Forms.NumericUpDown(); + this.label26 = new System.Windows.Forms.Label(); this.SkeletonsCheckBox = new System.Windows.Forms.CheckBox(); this.AudioOuterBoundsCheckBox = new System.Windows.Forms.CheckBox(); this.PopZonesCheckBox = new System.Windows.Forms.CheckBox(); @@ -258,6 +260,10 @@ namespace CodeWalker this.ToolbarTransformSpaceButton = new System.Windows.Forms.ToolStripSplitButton(); this.ToolbarObjectSpaceButton = new System.Windows.Forms.ToolStripMenuItem(); this.ToolbarWorldSpaceButton = new System.Windows.Forms.ToolStripMenuItem(); + this.ToolbarSnapButton = new CodeWalker.WinForms.ToolStripSplitButtonFix(); + this.ToolbarSnapToGroundButton = new System.Windows.Forms.ToolStripMenuItem(); + this.ToolbarSnapToGridButton = new System.Windows.Forms.ToolStripMenuItem(); + this.ToolbarSnapToGroundGridButton = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.ToolbarUndoButton = new System.Windows.Forms.ToolStripSplitButton(); this.ToolbarUndoListButton = new System.Windows.Forms.ToolStripMenuItem(); @@ -278,12 +284,6 @@ namespace CodeWalker this.ToolbarCameraMapViewButton = new System.Windows.Forms.ToolStripMenuItem(); this.ToolbarCameraOrthographicButton = new System.Windows.Forms.ToolStripMenuItem(); this.ToolbarPanel = new System.Windows.Forms.Panel(); - this.ToolbarSnapButton = new CodeWalker.WinForms.ToolStripSplitButtonFix(); - this.ToolbarSnapToGroundButton = new System.Windows.Forms.ToolStripMenuItem(); - this.ToolbarSnapToGridButton = new System.Windows.Forms.ToolStripMenuItem(); - this.ToolbarSnapToGroundGridButton = new System.Windows.Forms.ToolStripMenuItem(); - this.label26 = new System.Windows.Forms.Label(); - this.SnapGridSizeUpDown = new System.Windows.Forms.NumericUpDown(); this.StatusStrip.SuspendLayout(); this.ToolsPanel.SuspendLayout(); this.ToolsTabControl.SuspendLayout(); @@ -314,6 +314,7 @@ namespace CodeWalker ((System.ComponentModel.ISupportInitialize)(this.FieldOfViewTrackBar)).BeginInit(); this.tabPage14.SuspendLayout(); this.tabPage9.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.SnapGridSizeUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.BoundsRangeTrackBar)).BeginInit(); this.tabPage10.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.CloudParamTrackBar)).BeginInit(); @@ -324,7 +325,6 @@ namespace CodeWalker this.ToolsMenu.SuspendLayout(); this.Toolbar.SuspendLayout(); this.ToolbarPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.SnapGridSizeUpDown)).BeginInit(); this.SuspendLayout(); // // StatusStrip @@ -1785,6 +1785,39 @@ namespace CodeWalker this.tabPage9.Text = "Helpers"; this.tabPage9.UseVisualStyleBackColor = true; // + // SnapGridSizeUpDown + // + this.SnapGridSizeUpDown.DecimalPlaces = 2; + this.SnapGridSizeUpDown.Location = new System.Drawing.Point(86, 291); + this.SnapGridSizeUpDown.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.SnapGridSizeUpDown.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 131072}); + this.SnapGridSizeUpDown.Name = "SnapGridSizeUpDown"; + this.SnapGridSizeUpDown.Size = new System.Drawing.Size(108, 20); + this.SnapGridSizeUpDown.TabIndex = 49; + this.SnapGridSizeUpDown.Value = new decimal(new int[] { + 100, + 0, + 0, + 131072}); + this.SnapGridSizeUpDown.ValueChanged += new System.EventHandler(this.SnapGridSizeUpDown_ValueChanged); + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(4, 293); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(76, 13); + this.label26.TabIndex = 48; + this.label26.Text = "Snap grid size:"; + // // SkeletonsCheckBox // this.SkeletonsCheckBox.AutoSize = true; @@ -2641,7 +2674,7 @@ namespace CodeWalker this.ToolbarCameraModeButton}); this.Toolbar.Location = new System.Drawing.Point(1, 0); this.Toolbar.Name = "Toolbar"; - this.Toolbar.Size = new System.Drawing.Size(554, 25); + this.Toolbar.Size = new System.Drawing.Size(585, 25); this.Toolbar.TabIndex = 6; this.Toolbar.Text = "toolStrip1"; // @@ -2897,7 +2930,7 @@ namespace CodeWalker // this.ToolbarSelectMloInstanceButton.Name = "ToolbarSelectMloInstanceButton"; this.ToolbarSelectMloInstanceButton.Size = new System.Drawing.Size(181, 22); - this.ToolbarSelectMloInstanceButton.Text = "Mlo Instance"; + this.ToolbarSelectMloInstanceButton.Text = "Interior Instance"; this.ToolbarSelectMloInstanceButton.Click += new System.EventHandler(this.ToolbarSelectMloInstanceButton_Click); // // ToolbarSelectScenarioButton @@ -2971,7 +3004,7 @@ namespace CodeWalker this.ToolbarObjectSpaceButton.CheckState = System.Windows.Forms.CheckState.Checked; this.ToolbarObjectSpaceButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarObjectSpaceButton.Image"))); this.ToolbarObjectSpaceButton.Name = "ToolbarObjectSpaceButton"; - this.ToolbarObjectSpaceButton.Size = new System.Drawing.Size(152, 22); + this.ToolbarObjectSpaceButton.Size = new System.Drawing.Size(142, 22); this.ToolbarObjectSpaceButton.Text = "Object space"; this.ToolbarObjectSpaceButton.Click += new System.EventHandler(this.ToolbarObjectSpaceButton_Click); // @@ -2979,10 +3012,49 @@ namespace CodeWalker // this.ToolbarWorldSpaceButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarWorldSpaceButton.Image"))); this.ToolbarWorldSpaceButton.Name = "ToolbarWorldSpaceButton"; - this.ToolbarWorldSpaceButton.Size = new System.Drawing.Size(152, 22); + this.ToolbarWorldSpaceButton.Size = new System.Drawing.Size(142, 22); this.ToolbarWorldSpaceButton.Text = "World space"; this.ToolbarWorldSpaceButton.Click += new System.EventHandler(this.ToolbarWorldSpaceButton_Click); // + // ToolbarSnapButton + // + this.ToolbarSnapButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ToolbarSnapButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ToolbarSnapToGroundButton, + this.ToolbarSnapToGridButton, + this.ToolbarSnapToGroundGridButton}); + this.ToolbarSnapButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarSnapButton.Image"))); + this.ToolbarSnapButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ToolbarSnapButton.Name = "ToolbarSnapButton"; + this.ToolbarSnapButton.Size = new System.Drawing.Size(32, 22); + this.ToolbarSnapButton.Text = "Snap to Ground"; + this.ToolbarSnapButton.ToolTipText = "Snap to Ground"; + this.ToolbarSnapButton.ButtonClick += new System.EventHandler(this.ToolbarSnapButton_ButtonClick); + // + // ToolbarSnapToGroundButton + // + this.ToolbarSnapToGroundButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarSnapToGroundButton.Image"))); + this.ToolbarSnapToGroundButton.Name = "ToolbarSnapToGroundButton"; + this.ToolbarSnapToGroundButton.Size = new System.Drawing.Size(205, 22); + this.ToolbarSnapToGroundButton.Text = "Snap to Ground"; + this.ToolbarSnapToGroundButton.Click += new System.EventHandler(this.ToolbarSnapToGroundButton_Click); + // + // ToolbarSnapToGridButton + // + this.ToolbarSnapToGridButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarSnapToGridButton.Image"))); + this.ToolbarSnapToGridButton.Name = "ToolbarSnapToGridButton"; + this.ToolbarSnapToGridButton.Size = new System.Drawing.Size(205, 22); + this.ToolbarSnapToGridButton.Text = "Snap to Grid"; + this.ToolbarSnapToGridButton.Click += new System.EventHandler(this.ToolbarSnapToGridButton_Click); + // + // ToolbarSnapToGroundGridButton + // + this.ToolbarSnapToGroundGridButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarSnapToGroundGridButton.Image"))); + this.ToolbarSnapToGroundGridButton.Name = "ToolbarSnapToGroundGridButton"; + this.ToolbarSnapToGroundGridButton.Size = new System.Drawing.Size(205, 22); + this.ToolbarSnapToGroundGridButton.Text = "Snap to Grid and Ground"; + this.ToolbarSnapToGroundGridButton.Click += new System.EventHandler(this.ToolbarSnapToGroundGridButton_Click); + // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; @@ -3166,78 +3238,6 @@ namespace CodeWalker this.ToolbarPanel.TabIndex = 7; this.ToolbarPanel.Visible = false; // - // ToolbarSnapButton - // - this.ToolbarSnapButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.ToolbarSnapButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.ToolbarSnapToGroundButton, - this.ToolbarSnapToGridButton, - this.ToolbarSnapToGroundGridButton}); - this.ToolbarSnapButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarSnapButton.Image"))); - this.ToolbarSnapButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.ToolbarSnapButton.Name = "ToolbarSnapButton"; - this.ToolbarSnapButton.Size = new System.Drawing.Size(32, 22); - this.ToolbarSnapButton.Text = "Snap to Ground"; - this.ToolbarSnapButton.ToolTipText = "Snap to Ground"; - this.ToolbarSnapButton.ButtonClick += new System.EventHandler(this.ToolbarSnapButton_ButtonClick); - // - // ToolbarSnapToGroundButton - // - this.ToolbarSnapToGroundButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarSnapToGroundButton.Image"))); - this.ToolbarSnapToGroundButton.Name = "ToolbarSnapToGroundButton"; - this.ToolbarSnapToGroundButton.Size = new System.Drawing.Size(205, 22); - this.ToolbarSnapToGroundButton.Text = "Snap to Ground"; - this.ToolbarSnapToGroundButton.Click += new System.EventHandler(this.ToolbarSnapToGroundButton_Click); - // - // ToolbarSnapToGridButton - // - this.ToolbarSnapToGridButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarSnapToGridButton.Image"))); - this.ToolbarSnapToGridButton.Name = "ToolbarSnapToGridButton"; - this.ToolbarSnapToGridButton.Size = new System.Drawing.Size(205, 22); - this.ToolbarSnapToGridButton.Text = "Snap to Grid"; - this.ToolbarSnapToGridButton.Click += new System.EventHandler(this.ToolbarSnapToGridButton_Click); - // - // ToolbarSnapToGroundGridButton - // - this.ToolbarSnapToGroundGridButton.Image = ((System.Drawing.Image)(resources.GetObject("ToolbarSnapToGroundGridButton.Image"))); - this.ToolbarSnapToGroundGridButton.Name = "ToolbarSnapToGroundGridButton"; - this.ToolbarSnapToGroundGridButton.Size = new System.Drawing.Size(205, 22); - this.ToolbarSnapToGroundGridButton.Text = "Snap to Grid and Ground"; - this.ToolbarSnapToGroundGridButton.Click += new System.EventHandler(this.ToolbarSnapToGroundGridButton_Click); - // - // label26 - // - this.label26.AutoSize = true; - this.label26.Location = new System.Drawing.Point(4, 293); - this.label26.Name = "label26"; - this.label26.Size = new System.Drawing.Size(76, 13); - this.label26.TabIndex = 48; - this.label26.Text = "Snap grid size:"; - // - // SnapGridSizeUpDown - // - this.SnapGridSizeUpDown.DecimalPlaces = 2; - this.SnapGridSizeUpDown.Location = new System.Drawing.Point(86, 291); - this.SnapGridSizeUpDown.Maximum = new decimal(new int[] { - 1000, - 0, - 0, - 0}); - this.SnapGridSizeUpDown.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 131072}); - this.SnapGridSizeUpDown.Name = "SnapGridSizeUpDown"; - this.SnapGridSizeUpDown.Size = new System.Drawing.Size(108, 20); - this.SnapGridSizeUpDown.TabIndex = 49; - this.SnapGridSizeUpDown.Value = new decimal(new int[] { - 100, - 0, - 0, - 131072}); - this.SnapGridSizeUpDown.ValueChanged += new System.EventHandler(this.SnapGridSizeUpDown_ValueChanged); - // // WorldForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -3303,6 +3303,7 @@ namespace CodeWalker this.tabPage14.PerformLayout(); this.tabPage9.ResumeLayout(false); this.tabPage9.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.SnapGridSizeUpDown)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.BoundsRangeTrackBar)).EndInit(); this.tabPage10.ResumeLayout(false); this.tabPage10.PerformLayout(); @@ -3318,7 +3319,6 @@ namespace CodeWalker this.Toolbar.PerformLayout(); this.ToolbarPanel.ResumeLayout(false); this.ToolbarPanel.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.SnapGridSizeUpDown)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/WorldForm.cs b/WorldForm.cs index 5c5ed5c..5aebede 100644 --- a/WorldForm.cs +++ b/WorldForm.cs @@ -1231,6 +1231,7 @@ namespace CodeWalker const uint cgrn = 4278255360;// (uint)new Color4(0.0f, 1.0f, 0.0f, 1.0f).ToRgba(); const uint cblu = 4294901760;// (uint)new Color4(0.0f, 0.0f, 1.0f, 1.0f).ToRgba(); + const uint caqu = 4294967040;// (uint)new Color4(0.0f, 1.0f, 1.0f, 1.0f).ToRgba(); if (MouseRayCollisionEnabled && MouseRayCollisionVisible) { @@ -1353,6 +1354,58 @@ namespace CodeWalker { bbmin = selectionItem.AABB.Minimum; bbmax = selectionItem.AABB.Maximum; + var mlo = selectionItem.MloEntityDef; + var mlop = mlo.Position; + var mloa = mlo.Archetype as MloArchetype; + if (mloa != null) + { + VertexTypePC p1 = new VertexTypePC(); + VertexTypePC p2 = new VertexTypePC(); + if (mloa.portals != null) + { + p1.Colour = caqu; + p2.Colour = caqu; + for (int ip = 0; ip < mloa.portals.Length; ip++) + { + var portal = mloa.portals[ip]; + if (portal.Corners == null) continue; + for (int ic = 0; ic < portal.Corners.Length; ic++) + { + int il = ((ic==0)? portal.Corners.Length : ic) - 1; + p1.Position = mlop + mlo.Orientation.Multiply(portal.Corners[il].XYZ()); + p2.Position = mlop + mlo.Orientation.Multiply(portal.Corners[ic].XYZ()); + Renderer.SelectionLineVerts.Add(p1); + Renderer.SelectionLineVerts.Add(p2); + } + } + } + if (mloa.rooms != null) + { + MapBox wbox = new MapBox(); + wbox.Scale = Vector3.One; + for (int ir = 0; ir < mloa.rooms.Length; ir++) + { + var room = mloa.rooms[ir]; + + wbox.CamRelPos = mlop - camera.Position; + wbox.BBMin = room._Data.bbMin;// + offset; + wbox.BBMax = room._Data.bbMax;// + offset; + wbox.Orientation = mlo.Orientation; + if ((ir == 0) || (room.RoomName == "limbo")) + { + bbmin = room._Data.bbMin; + bbmax = room._Data.bbMax; + //////Renderer.BoundingBoxes.Add(wbox); + } + else + { + wbox.BBMin = room.BBMin_CW; //hack method to use CW calculated room AABBs, + wbox.BBMax = room.BBMax_CW; //R* ones are right size, but wrong position?? + Renderer.WhiteBoxes.Add(wbox); + } + } + } + } } if ((selectionItem.GrassBatch != null) || (selectionItem.ArchetypeExtension != null) || (selectionItem.EntityExtension != null) || (selectionItem.CollisionBounds != null)) { @@ -1394,7 +1447,6 @@ namespace CodeWalker } } - if (mode == BoundsShaderMode.Box) { MapBox box = new MapBox(); @@ -2455,6 +2507,7 @@ namespace CodeWalker for (int i = 0; i < ymap.MloEntities.Length; i++) { var ent = ymap.MloEntities[i]; + if (SelectedItem.MloEntityDef == ent) continue; MapBox mb = new MapBox(); mb.CamRelPos = ent.Position - camera.Position; mb.BBMin = /*ent?.BBMin ??*/ new Vector3(-1.5f); diff --git a/WorldForm.resx b/WorldForm.resx index 091ca9d..fe93ed0 100644 --- a/WorldForm.resx +++ b/WorldForm.resx @@ -240,14 +240,6 @@ ufo YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAB4SURBVDhP3ZC7DcAgDEQZKTMwHOvSIFriS7BlEB+HMic9 QJbvFThLUkpXzjkSpaeuzMPlEEL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