// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 namespace GLTFast { /// /// This struct holds the result of a glTF to Unity mesh conversion. /// During an import, glTF meshes (composed of primitives) will be converted to Unity Meshes (with sub-meshes). /// glTF meshes and Unity Meshes do not necessarily relate one-to-one. One glTF mesh (with multiple primitives) /// might be converted to multiple Unity Meshes (e.g. because of incompatible vertex buffer structure). /// public readonly struct MeshResult { /// Original glTF mesh index public readonly int meshIndex; /// Original glTF mesh primitive index per sub-mesh public readonly int[] primitiveIndices; /// glTF material index per sub-mesh public readonly int[] materialIndices; /// Converted Unity Mesh public readonly UnityEngine.Mesh mesh; // public readonly Dictionary extensionData; /// /// MeshResult Constructor /// /// Original glTF mesh index /// Original glTF mesh primitive index per sub-mesh /// glTF material index per sub-mesh /// Converted Unity Mesh public MeshResult( int meshIndex, int[] primitiveIndices, int[] materialIndices, UnityEngine.Mesh mesh ) { this.meshIndex = meshIndex; this.primitiveIndices = primitiveIndices; this.materialIndices = materialIndices; this.mesh = mesh; } } }