#if (UNITY_EDITOR && !UNITY_EDITOR_LINUX) namespace ECE { using UnityEngine; using System.Collections.Generic; [System.Serializable] public class VHACDParameters { public float NormalExtrudeMultiplier = 0.0f; [HideInInspector] /// /// is the current calculation for displaying a preview? /// public bool IsCalculationForPreview; public VHACD_CONVERSION ConvertTo; [HideInInspector] /// /// the suffix to add to saved convex hulls: objectName_suffix_01 etc. /// public string SaveSuffix = "_ConvexHull_"; /// /// Method to use to attach resulting convex hulls to attach to object. /// public VHACD_RESULT_METHOD vhacdResultMethod = VHACD_RESULT_METHOD.AttachTo; [HideInInspector] /// /// Run VHACD only on the selected vertices? /// public bool UseSelectedVertices = false; [HideInInspector] /// /// Current mesh filter VHACD is calculating. /// public int CurrentMeshFilter = 0; [HideInInspector] /// /// Should child meshes be seperately done in the calculation / adding of convex hulls. /// public bool SeparateChildMeshes = false; [HideInInspector] /// /// should the attach to method be run per mesh that is separated? /// public bool PerMeshAttachOverride = false; [HideInInspector] /// /// List of mesh filters for VHACD calculation. /// public List MeshFilters = new List(); [HideInInspector] /// /// Gameobject to attach mesh colliders to using the result of VHACD. /// public GameObject AttachTo; [HideInInspector] /// /// Save path of current VHACD meshes /// public string SavePath; [Range(0, 1f)] /// /// maximum concavity /// public double concavity; [Range(0, 1f)] /// /// controls bias toward clipping along symmetry planes /// public double alpha; [Range(0, 1f)] /// /// controls bias toward clipping along revolution axes /// public double beta; [Range(0, 1f)] /// /// controls adaptive sampling of the generated convex-hulls /// public double minVolumePerCH; [Range(10000, 64000000)] /// /// maximum number of voxels generated during voxelization stage /// public int resolution; [Range(4, 1024)] /// /// controls maximum number of triangles per convex hull /// public int maxNumVerticesPerConvexHull; [Range(1, 16)] /// /// controls the granularity of the search for the "best" clipping plane /// public int planeDownsampling; [Range(1, 16)] /// /// controls the precision of the convex-hull generation process during the clipping plane selection stage /// public int convexhullDownSampling; [Range(1, 128)] /// /// maximum number of convex hulls /// public int maxConvexHulls; /// /// When enabled, will project the output convex hull vertices onto the original source mesh /// public bool projectHullVertices; /// /// Fill mode to determine what is inside/outside the mesh /// Flood fill: basic flood fill algorithm /// Raycast fill: raycasts are used to determine inside/outside /// Surface: used when the surface is to represent a hollow object. /// public VHACD_FILL_MODE fillMode; /// /// Should we force recalculation when resulting hulls have a hull with triangle count >=256. /// public bool forceUnder256Triangles; /// /// Creates a VHACD parameters object with default values. /// public VHACDParameters() { concavity = 0.0025; alpha = 0.05; beta = 0.05; minVolumePerCH = 0.0001; resolution = 10000; maxNumVerticesPerConvexHull = 64; planeDownsampling = 4; convexhullDownSampling = 4; maxConvexHulls = 1; projectHullVertices = true; fillMode = VHACD_FILL_MODE.FLOOD_FILL; forceUnder256Triangles = true; } /// /// Creates a VHACDParameters object with the values of another VHACDParam /// /// Values to copy from public VHACDParameters(VHACDParameters other) { ConvertTo = other.ConvertTo; SaveSuffix = other.SaveSuffix; vhacdResultMethod = other.vhacdResultMethod; AttachTo = other.AttachTo; concavity = other.concavity; alpha = other.alpha; beta = other.beta; minVolumePerCH = other.minVolumePerCH; resolution = other.resolution; maxNumVerticesPerConvexHull = other.maxNumVerticesPerConvexHull; planeDownsampling = other.planeDownsampling; convexhullDownSampling = other.convexhullDownSampling; maxConvexHulls = other.maxConvexHulls; projectHullVertices = other.projectHullVertices; fillMode = other.fillMode; forceUnder256Triangles = other.forceUnder256Triangles; SeparateChildMeshes = other.SeparateChildMeshes; UseSelectedVertices = other.UseSelectedVertices; MeshFilters = new List(); foreach (MeshFilter f in other.MeshFilters) { MeshFilters.Add(f); } NormalExtrudeMultiplier = other.NormalExtrudeMultiplier; PerMeshAttachOverride = other.PerMeshAttachOverride; } /// /// Clones the current instance of VHACDParameters. /// /// Copy of the VHACDParameters instance. public VHACDParameters Clone() { return new VHACDParameters(this); } } } #endif