namespace LightlessSync.LightlessConfiguration.Configurations; public static class ModelDecimationDefaults { public const bool EnableAutoDecimation = false; public const int TriangleThreshold = 15_000; public const double TargetRatio = 0.8; public const bool NormalizeTangents = true; public const bool AvoidBodyIntersection = true; /// Default triangle threshold for batch decimation (0 = no threshold). public const int BatchTriangleThreshold = 0; /// Default target triangle ratio for batch decimation. public const double BatchTargetRatio = 0.8; /// Default tangent normalization toggle for batch decimation. public const bool BatchNormalizeTangents = true; /// Default body collision guard toggle for batch decimation. public const bool BatchAvoidBodyIntersection = true; /// Default display for the batch decimation warning overlay. public const bool ShowBatchDecimationWarning = true; public const bool KeepOriginalModelFiles = true; public const bool SkipPreferredPairs = true; public const bool AllowBody = false; public const bool AllowFaceHead = false; public const bool AllowTail = false; public const bool AllowClothing = true; public const bool AllowAccessories = true; } public sealed class ModelDecimationAdvancedSettings { /// Minimum triangles per connected component before skipping decimation. public const int DefaultMinComponentTriangles = 6; /// Average-edge multiplier used to cap collapses. public const float DefaultMaxCollapseEdgeLengthFactor = 1.25f; /// Maximum normal deviation (degrees) allowed for a collapse. public const float DefaultNormalSimilarityThresholdDegrees = 60f; /// Minimum bone-weight overlap required to allow a collapse. public const float DefaultBoneWeightSimilarityThreshold = 0.85f; /// UV similarity threshold to protect seams. public const float DefaultUvSimilarityThreshold = 0.02f; /// UV seam cosine threshold for blocking seam collapses. public const float DefaultUvSeamAngleCos = 0.99f; /// Whether to block UV seam vertices from collapsing. public const bool DefaultBlockUvSeamVertices = true; /// Whether to allow collapses on boundary edges. public const bool DefaultAllowBoundaryCollapses = false; /// Body collision distance factor for the primary pass. public const float DefaultBodyCollisionDistanceFactor = 0.75f; /// Body collision distance factor for the relaxed fallback pass. public const float DefaultBodyCollisionNoOpDistanceFactor = 0.25f; /// Relax multiplier applied when the mesh is close to the body. public const float DefaultBodyCollisionAdaptiveRelaxFactor = 1.0f; /// Ratio of near-body vertices required to trigger relaxation. public const float DefaultBodyCollisionAdaptiveNearRatio = 0.4f; /// UV threshold for relaxed body-collision mode. public const float DefaultBodyCollisionAdaptiveUvThreshold = 0.08f; /// UV seam cosine threshold for relaxed body-collision mode. public const float DefaultBodyCollisionNoOpUvSeamAngleCos = 0.98f; /// Expansion factor for protected vertices near the body. public const float DefaultBodyCollisionProtectionFactor = 1.5f; /// Minimum ratio used when decimating the body proxy. public const float DefaultBodyProxyTargetRatioMin = 0.85f; /// Inflation applied to body collision distances. public const float DefaultBodyCollisionProxyInflate = 0.0005f; /// Body collision penetration factor used during collapse checks. public const float DefaultBodyCollisionPenetrationFactor = 0.75f; /// Minimum body collision distance threshold. public const float DefaultMinBodyCollisionDistance = 0.0001f; /// Minimum cell size for body collision spatial hashing. public const float DefaultMinBodyCollisionCellSize = 0.0001f; /// Minimum triangles per connected component before skipping decimation. public int MinComponentTriangles { get; set; } = DefaultMinComponentTriangles; /// Average-edge multiplier used to cap collapses. public float MaxCollapseEdgeLengthFactor { get; set; } = DefaultMaxCollapseEdgeLengthFactor; /// Maximum normal deviation (degrees) allowed for a collapse. public float NormalSimilarityThresholdDegrees { get; set; } = DefaultNormalSimilarityThresholdDegrees; /// Minimum bone-weight overlap required to allow a collapse. public float BoneWeightSimilarityThreshold { get; set; } = DefaultBoneWeightSimilarityThreshold; /// UV similarity threshold to protect seams. public float UvSimilarityThreshold { get; set; } = DefaultUvSimilarityThreshold; /// UV seam cosine threshold for blocking seam collapses. public float UvSeamAngleCos { get; set; } = DefaultUvSeamAngleCos; /// Whether to block UV seam vertices from collapsing. public bool BlockUvSeamVertices { get; set; } = DefaultBlockUvSeamVertices; /// Whether to allow collapses on boundary edges. public bool AllowBoundaryCollapses { get; set; } = DefaultAllowBoundaryCollapses; /// Body collision distance factor for the primary pass. public float BodyCollisionDistanceFactor { get; set; } = DefaultBodyCollisionDistanceFactor; /// Body collision distance factor for the relaxed fallback pass. public float BodyCollisionNoOpDistanceFactor { get; set; } = DefaultBodyCollisionNoOpDistanceFactor; /// Relax multiplier applied when the mesh is close to the body. public float BodyCollisionAdaptiveRelaxFactor { get; set; } = DefaultBodyCollisionAdaptiveRelaxFactor; /// Ratio of near-body vertices required to trigger relaxation. public float BodyCollisionAdaptiveNearRatio { get; set; } = DefaultBodyCollisionAdaptiveNearRatio; /// UV threshold for relaxed body-collision mode. public float BodyCollisionAdaptiveUvThreshold { get; set; } = DefaultBodyCollisionAdaptiveUvThreshold; /// UV seam cosine threshold for relaxed body-collision mode. public float BodyCollisionNoOpUvSeamAngleCos { get; set; } = DefaultBodyCollisionNoOpUvSeamAngleCos; /// Expansion factor for protected vertices near the body. public float BodyCollisionProtectionFactor { get; set; } = DefaultBodyCollisionProtectionFactor; /// Minimum ratio used when decimating the body proxy. public float BodyProxyTargetRatioMin { get; set; } = DefaultBodyProxyTargetRatioMin; /// Inflation applied to body collision distances. public float BodyCollisionProxyInflate { get; set; } = DefaultBodyCollisionProxyInflate; /// Body collision penetration factor used during collapse checks. public float BodyCollisionPenetrationFactor { get; set; } = DefaultBodyCollisionPenetrationFactor; /// Minimum body collision distance threshold. public float MinBodyCollisionDistance { get; set; } = DefaultMinBodyCollisionDistance; /// Minimum cell size for body collision spatial hashing. public float MinBodyCollisionCellSize { get; set; } = DefaultMinBodyCollisionCellSize; }