From cf58771365b5953c6eac548b172aae880d1f0acd Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sun, 19 May 2024 17:03:57 +0800 Subject: * rename --- .../Decompile/NGS.MeshFusionPro/CombineTree.cs | 112 --------------------- 1 file changed, 112 deletions(-) delete mode 100644 Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineTree.cs (limited to 'Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineTree.cs') diff --git a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineTree.cs b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineTree.cs deleted file mode 100644 index 2fd39af..0000000 --- a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombineTree.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using UnityEngine; - -namespace NGS.MeshFusionPro; - -public class CombineTree : BinaryTree -{ - private ICombinedMeshFactory _factory; - - private float _leafSize; - - private int _vertexLimit; - - public float LeafSize => _leafSize; - - public int VertexLimit => _vertexLimit; - - public ICombinedMeshFactory CombinedMeshFactory => _factory; - - public event Action onStaticCombinedObjectCreated; - - public event Action onDynamicCombinedObjectCreated; - - public event Action onCombinedLODGroupCreated; - - public CombineTree(ICombinedMeshFactory factory, float leafSize, int vertexLimit) - { - _factory = factory; - _leafSize = leafSize; - _vertexLimit = vertexLimit; - } - - public void Combine() - { - TreeTraversal(delegate(CombineTreeNode node, int depth) - { - node.Combine(); - return true; - }); - } - - protected override CombineTreeNode CreateRoot(ICombineSource source) - { - return CreateNode(source.Position, Vector3.one * _leafSize, isLeaf: true); - } - - protected override CombineTreeNode CreateNode(Vector3 center, Vector3 size, bool isLeaf) - { - CombineTreeNode combineTreeNode = new CombineTreeNode(this, center, size, isLeaf); - combineTreeNode.onStaticCombinedObjectCreated += this.onStaticCombinedObjectCreated; - combineTreeNode.onDynamicCombinedObjectCreated += this.onDynamicCombinedObjectCreated; - combineTreeNode.onCombinedLODGroupCreated += this.onCombinedLODGroupCreated; - return combineTreeNode; - } - - protected override CombineTreeNode ExpandRoot(CombineTreeNode root, ICombineSource target) - { - Bounds bounds = root.Bounds; - Bounds bounds2 = target.Bounds; - Vector3 center = Vector3.zero; - Vector3 size = Vector3.zero; - Vector3 center2 = Vector3.zero; - bool flag = false; - for (int i = 0; i < 3; i++) - { - if (bounds2.min[i] < bounds.min[i]) - { - size = bounds.size; - size[i] *= 2f; - center = bounds.center; - center[i] -= bounds.size[i] / 2f; - center2 = bounds.center; - center2[i] -= bounds.size[i]; - break; - } - if (bounds2.max[i] > bounds.max[i]) - { - size = bounds.size; - size[i] *= 2f; - center = bounds.center; - center[i] += bounds.size[i] / 2f; - center2 = bounds.center; - center2[i] += bounds.size[i]; - flag = true; - break; - } - } - CombineTreeNode combineTreeNode = CreateNode(center, size, isLeaf: false); - CombineTreeNode combineTreeNode2 = CreateNode(center2, bounds.size, root.IsLeaf); - if (flag) - { - combineTreeNode.SetChilds(base.RootInternal, combineTreeNode2); - } - else - { - combineTreeNode.SetChilds(combineTreeNode2, base.RootInternal); - } - return combineTreeNode; - } - - protected override bool Includes(CombineTreeNode node, ICombineSource source) - { - Bounds bounds = node.Bounds; - Bounds bounds2 = source.Bounds; - return bounds.Contains(bounds2); - } - - protected override bool Intersects(CombineTreeNode node, ICombineSource source) - { - return node.Bounds.Contains(source.Position); - } -} -- cgit v1.1-26-g67d0