// Magica Cloth 2.
// Copyright (c) 2023 MagicaSoft.
// https://magicasoft.jp
using Unity.Mathematics;
namespace MagicaCloth2
{
public static partial class Define
{
///
/// システム関連デファイン
///
public static class System
{
///
/// プロジェクトセッティングに登録するDefineシンボル
///
public const string DefineSymbol = "MAGICACLOTH2";
///
/// 現在有効なPreBuildの最新バージョン
///
public const int LatestPreBuildVersion = 2;
///
/// 計算を省略する最小の浮動小数点数
///
public const float Epsilon = 1e-8f;
///
/// MeshClothで設定可能な最大レンダラー数
///
public const int MaxRendererCount = 31;
///
/// 最小のグリッドサイズ定義(GridSize=0は動作しないため)
///
public const float MinimumGridSize = 0.00001f;
///
/// 生成できるチーム数
///
public const int MaximumTeamCount = 4096;
///
/// シミュレーション周波数初期値
///
public const int DefaultSimulationFrequency = 90;
///
/// シミュレーション周波数最小値
///
public const int SimulationFrequency_Low = 30;
///
/// シミュレーション周波数最大値
///
public const int SimulationFrequency_Hi = 150;
///
/// 1フレームでの最大更新回数初期値
///
public const int DefaultMaxSimulationCountPerFrame = 3;
///
/// 1フレームでの最大更新回数最小
///
public const int MaxSimulationCountPerFrame_Low = 1;
///
/// 1フレームでの最大更新回数最大
///
public const int MaxSimulationCountPerFrame_Hi = 5;
///
/// 法線整列時に同一の面(レイヤー)として判定する隣接トライアングルのなす角(デグリー)
///
public const float SameSurfaceAngle = 80.0f;
///
/// [Reduction]
/// 有効フラグ。常にtrueとする。
///
public const bool ReductionEnable = true;
///
/// [Reduction]
/// 同一頂点として判定する距離(AABB最大距離の%)(0.0 ~ 1.0)
///
public const float ReductionSameDistance = 0.001f;
///
/// [Reduction]
/// 極力ラインを作らない接続を行う
///
public const bool ReductionDontMakeLine = true;
///
/// [Reduction]
/// 結合頂点位置の調整
/// (0.0=接続頂点数の多いほど動かない, 1.0=完全に平均化)
///
public const float ReductionJoinPositionAdjustment = 1.0f;
///
/// [Reduction]
/// 最大ステップ回数
///
public const int ReductionMaxStep = 100;
///
/// [ProxyMesh]
/// 有効な最大頂点数
///
public const int MaxProxyMeshVertexCount = 32767;
///
/// [ProxyMesh]
/// 有効な最大エッジ数
///
public const int MaxProxyMeshEdgeCount = 32767;
///
/// [ProxyMesh]
/// 有効な最大トライアングル数
///
public const int MaxProxyMeshTriangleCount = 32767;
///
/// [ProxyMesh]
/// トライアングルのペアと判定する角度(Deg)
///
public const float ProxyMeshTrianglePairAngle = 20.0f;
///
/// [ProxyMesh]
/// BoneClothのMesh接続時にトライアングルとして判断される内角
///
public const float ProxyMeshBoneClothTriangleAngle = 120.0f;
///
/// [Simulation]
/// 摩擦(0.0 ~ 1.0)に対する増加重量
///
public const float FrictionMass = 3.0f;
///
/// [Simulation]
/// 深さ(0.0 ~ 1.0)に対する増加重量(深さ0.0のときに最大になる)
///
public const float DepthMass = 5.0f;
///
/// [Simulation]
/// ステップごとの摩擦減衰率
///
public const float FrictionDampingRate = 0.6f;
///
/// [Simulation]
/// アトミック加算による移動ベクトルの平均化に使用する加算数に対する指数
///
public const float PositionAverageExponent = 0.5f; // 0.5?
///
/// [Simulation]
/// 未来予測に用いる実速度の最大速度クランプ(m/s)
/// これはセルフコジョンなどで意図しない表示突き抜けを防止するために必要!
///
public const float MaxRealVelocity = 0.5f;
///
/// [Simulation]
/// パーティクルの最大速度(m/s)
///
//public const float ParticleSpeedLimit = 3.0f;
///
/// [Tether]
/// 縮み剛性(0.0 ~ 1.0)
///
public const float TetherCompressionStiffness = 1.0f; // 0.1?
///
/// [Tether]
/// 伸び剛性(0.0 ~ 1.0)
///
public const float TetherStretchStiffness = 1.0f; // 1.0f?
///
/// [Tether]
/// 最大拡大割合(0.0 ~ 1.0)
/// 0.0=拡大しない
///
public const float TetherStretchLimit = 0.03f; // 0.0?
///
/// [Tether]
/// stiffnessのフェード範囲(0.0 ~ 1.0)
///
public const float TetherStiffnessWidth = 0.3f; // 0.2?
///
/// [Tether]
/// 拡大時の速度減衰(0.0 ~ 1.0)
///
public const float TetherCompressionVelocityAttenuation = 0.7f;
///
/// [Tether]
/// 縮小時の速度減衰(0.0 ~ 1.0)
///
public const float TetherStretchVelocityAttenuation = 0.7f; // 0.9f?
///
/// [Distance]
/// 速度減衰(0.0 ~ 1.0)
///
public const float DistanceVelocityAttenuation = 0.3f;
///
/// [Distance]
/// 縦接続の剛性(0.0 ~ 1.0)
///
public const float DistanceVerticalStiffness = 1.0f;
///
/// [Distance]
/// 横およびShear接続の剛性(0.0 ~ 1.0)
///
public const float DistanceHorizontalStiffness = 0.5f;
///
/// [Triangle Bending]
/// TriangleBendを形成する最大の角度
///
public const float TriangleBendingMaxAngle = 120.0f; // 145?
///
/// [Volume]
/// Volumeを形成する最小のTriangleペア角度
///
public const float VolumeMinAngle = 90.0f;
///
/// [Angle Limit]
/// 角度制限の最大角度(deg)
///
public const float MaxAngleLimit = 179.0f;
///
/// [Angle Limit]
/// 反復回数
///
public const int AngleLimitIteration = 3;
///
/// [Angle Limit]
/// 速度減衰(0.0 ~ 1.0)
///
public const float AngleLimitAttenuation = 0.9f;
///
/// [Inertia]
/// 設定できる最大移動速度(m/s)
///
public const float MaxMovementSpeedLimit = 10.0f;
///
/// [Inertia]
/// 設定できる最大回転速度(deg/s)
///
public const float MaxRotationSpeedLimit = 1440.0f;
///
/// [Inertia]
/// 設定できる最大のパーティクル移動速度(m/s)
///
public const float MaxParticleSpeedLimit = 10.0f;
///
/// [Collider Collision]
/// 一度に拡張するコライダー数
///
public const int ExpandedColliderCount = 8;
///
/// [Collider Collision]
/// 設定frictionに対するDynamicFrictionの割合(0.0 ~ 1.0)
///
public const float ColliderCollisionDynamicFrictionRatio = 1.0f;
///
/// [Collider Collision]
/// 設定frictionに対するStaticFrictionの割合(0.0 ~ 1.0)
///
public const float ColliderCollisionStaticFrictionRatio = 1.0f;
///
/// [Collider Collision]
/// 速度減衰(0.0 ~ 1.0)
///
//public const float ColliderCollisionVelocityAttenuation = 0.0f;
///
/// [Custom Skinning]
/// ボーンラインからの角度による減衰率(0.0~1.0)
///
public const float CustomSkinningAngularAttenuation = 1.0f;
///
/// [Custom Skinning]
/// 最近ポイントのウエイト強度(0.0~1.0)
///
public const float CustomSkinningDistanceReduction = 0.6f;
///
/// [Custom Skinning]
/// 距離によりウエイトの減衰乗数(だいたい0.1 ~ 5.0)
///
public const float CustomSkinningDistancePow = 2.0f;
///
/// [Self Collision]
/// 反復回数
///
public const int SelfCollisionSolverIteration = 4;
///
/// [Self Collision]
/// セルフコリジョン解決時の固定パーティクル重量
///
public const float SelfCollisionFixedMass = 100.0f;
///
/// [Self Collision]
/// セルフコリジョン解決時の摩擦1.0に対する重量
///
public const float SelfCollisionFrictionMass = 10.0f;
///
/// [Self Collision]
/// セルフコリジョンのチーム重量係数
///
public const float SelfCollisionClothMass = 50.0f;
///
/// [Self Collision]
/// 厚み(thickness)に対するSCRスケール
///
public const float SelfCollisionSCR = 2.0f; // 1.0
///
/// [Self Collision]
/// PointTriangleの有効判定角度(deg)
///
public static readonly float SelfCollisionPointTriangleAngleCos = math.cos(math.radians(60.0f));
///
/// [Self Collision]
/// 交差判定の分割数
///
public const int SelfCollisionIntersectDiv = 8;
///
/// [Self Collision]
/// Thicknessの最小値(m)
///
public const float SelfCollisionThicknessMin = 0.001f;
///
/// [Self Collision]
/// Thicknessの最大値(m)
///
public const float SelfCollisionThicknessMax = 0.05f;
///
/// [Wind]
/// 風時間の最大値
///
public const float WindMaxTime = 10000.0f;
///
/// [Wind]
/// 風速係数の基準となる風速(m/s)
///
public const float WindBaseSpeed = 7.5f;
///
/// [Spring]
/// BoneSpring利用時のDistanceConstraintのStiffness値
///
public const float BoneSpringDistanceStiffness = 0.5f;
///
/// [Spring]
/// BoneSpring利用時のTetherConstraintのCompressionLimit値
///
public const float BoneSpringTetherCompressionLimit = 0.8f;
///
/// [Spring]
/// BoneSpring利用時のfriction値
///
public const float BoneSpringCollisionFriction = 0.5f;
}
}
}