From 16d13e1289dc40c1fbc764b0df4b0444cb644add Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 7 Mar 2022 14:21:58 +0900 Subject: [PATCH] private --- .../Runtime/MeshUtility/MeshIntegrator.cs | 57 ++++++------------- 1 file changed, 16 insertions(+), 41 deletions(-) diff --git a/Assets/UniGLTF/Runtime/MeshUtility/MeshIntegrator.cs b/Assets/UniGLTF/Runtime/MeshUtility/MeshIntegrator.cs index b63570d11..569fa4bdf 100644 --- a/Assets/UniGLTF/Runtime/MeshUtility/MeshIntegrator.cs +++ b/Assets/UniGLTF/Runtime/MeshUtility/MeshIntegrator.cs @@ -6,13 +6,16 @@ namespace UniGLTF.MeshUtility { public class MeshIntegrator { - public struct SubMesh + public const string INTEGRATED_MESH_NAME = "MeshesIntegrated"; + public const string INTEGRATED_MESH_BLENDSHAPE_NAME = "MeshesBlendShapeIntegrated"; + + struct SubMesh { public List Indices; public Material Material; } - public class BlendShape + class BlendShape { public int VertexOffset; public string Name; @@ -22,24 +25,17 @@ namespace UniGLTF.MeshUtility public Vector3[] Tangents; } - public MeshIntegrationResult Result; - public List Positions { get; private set; } - public List Normals { get; private set; } - public List UV { get; private set; } - public List Tangents { get; private set; } - public List BoneWeights { get; private set; } - - public List SubMeshes - { - get; - private set; - } - - public List BindPoses { get; private set; } - public List Bones { get; private set; } - - public List BlendShapes { get; private set; } - public void AddBlendShapesToMesh(Mesh mesh) + public MeshIntegrationResult Result { get; } = new MeshIntegrationResult(); + List Positions { get; } = new List(); + List Normals { get; } = new List(); + List UV { get; } = new List(); + List Tangents { get; } = new List(); + List BoneWeights { get; } = new List(); + List SubMeshes { get; } = new List(); + List BindPoses { get; } = new List(); + List Bones { get; } = new List(); + List BlendShapes { get; } = new List(); + void AddBlendShapesToMesh(Mesh mesh) { Dictionary map = new Dictionary(); @@ -74,24 +70,6 @@ namespace UniGLTF.MeshUtility } } - public MeshIntegrator() - { - Result = new MeshIntegrationResult(); - - Positions = new List(); - Normals = new List(); - UV = new List(); - Tangents = new List(); - BoneWeights = new List(); - - SubMeshes = new List(); - - BindPoses = new List(); - Bones = new List(); - - BlendShapes = new List(); - } - static BoneWeight AddBoneIndexOffset(BoneWeight bw, int boneIndexOffset) { if (bw.weight0 > 0) bw.boneIndex0 += boneIndexOffset; @@ -252,9 +230,6 @@ namespace UniGLTF.MeshUtility } } - public const string INTEGRATED_MESH_NAME = "MeshesIntegrated"; - public const string INTEGRATED_MESH_BLENDSHAPE_NAME = "MeshesBlendShapeIntegrated"; - public void Intgrate(bool onlyBlendShapeRenderers) { var mesh = new Mesh();