1
0
mirror of synced 2024-12-01 02:27:22 +01:00

BFRES : Create new bounding nodes for regenerated bounding boxes

This commit is contained in:
KillzXGaming 2020-04-01 14:39:11 -04:00
parent e6bfadbaf0
commit 7c75bb3a47

View File

@ -362,9 +362,10 @@ namespace Bfres.Structs
//Todo add lod generating //Todo add lod generating
CreateNewBoundingBoxes(); CreateNewBoundingBoxes();
SaveShape(GetResFileU() != null); SaveShape(GetResFileU() != null);
UpdateVertexData(); UpdateVertexData();
GenerateBoundingNodes();
Cursor.Current = Cursors.Default; Cursor.Current = Cursors.Default;
} }
@ -383,12 +384,32 @@ namespace Bfres.Structs
} }
CreateNewBoundingBoxes(); CreateNewBoundingBoxes();
SaveShape(GetResFileU() != null); SaveShape(GetResFileU() != null);
UpdateVertexData(); UpdateVertexData();
GenerateBoundingNodes();
Cursor.Current = Cursors.Default; Cursor.Current = Cursors.Default;
} }
private void GenerateBoundingNodes()
{
if (ShapeU != null)
{
ShapeU.SubMeshBoundingIndices = new List<ushort>();
ShapeU.SubMeshBoundingIndices.Add(0);
ShapeU.SubMeshBoundingNodes = new List<ResU.BoundingNode>();
ShapeU.SubMeshBoundingNodes.Add(new ResU.BoundingNode()
{
LeftChildIndex = 0,
NextSibling = 0,
SubMeshIndex = 0,
RightChildIndex = 0,
Unknown = 0,
SubMeshCount = 1,
});
}
}
private void RecalculateNormals(object sender, EventArgs args) private void RecalculateNormals(object sender, EventArgs args)
{ {
Cursor.Current = Cursors.WaitCursor; Cursor.Current = Cursors.WaitCursor;