#region License /* MIT License Copyright(c) 2019 Mattias Edlund Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #endregion using System; using UnityEngine; namespace UnityMeshSimplifier { /// /// Options for mesh simplification. /// [Serializable] public struct SimplificationOptions { /// /// The default simplification options. /// public static readonly SimplificationOptions Default = new SimplificationOptions() { PreserveBorderEdges = false, PreserveUVSeamEdges = false, PreserveUVFoldoverEdges = false, EnableSmartLink = true, VertexLinkDistance = double.Epsilon, MaxIterationCount = 100, Agressiveness = 7.0 }; /// /// If the border edges should be preserved. /// Default value: false /// [Tooltip("If the border edges should be preserved.")] public bool PreserveBorderEdges; /// /// If the UV seam edges should be preserved. /// Default value: false /// [Tooltip("If the UV seam edges should be preserved.")] public bool PreserveUVSeamEdges; /// /// If the UV foldover edges should be preserved. /// Default value: false /// [Tooltip("If the UV foldover edges should be preserved.")] public bool PreserveUVFoldoverEdges; /// /// If a feature for smarter vertex linking should be enabled, reducing artifacts in the /// decimated result at the cost of a slightly more expensive initialization by treating vertices at /// the same position as the same vertex while separating the attributes. /// Default value: true /// [Tooltip("If a feature for smarter vertex linking should be enabled, reducing artifacts at the cost of slower simplification.")] public bool EnableSmartLink; /// /// The maximum distance between two vertices in order to link them. /// Note that this value is only used if EnableSmartLink is true. /// Default value: double.Epsilon /// [Tooltip("The maximum distance between two vertices in order to link them.")] public double VertexLinkDistance; /// /// The maximum iteration count. Higher number is more expensive but can bring you closer to your target quality. /// Sometimes a lower maximum count might be desired in order to lower the performance cost. /// Default value: 100 /// [Tooltip("The maximum squared distance between two vertices in order to link them.")] public int MaxIterationCount; /// /// The agressiveness of the mesh simplification. Higher number equals higher quality, but more expensive to run. /// Default value: 7.0 /// [Tooltip("The agressiveness of the mesh simplification. Higher number equals higher quality, but more expensive to run.")] public double Agressiveness; } }