Fix : 보정 계산법 업데이트
This commit is contained in:
parent
649debd3e7
commit
b6238e41d4
@ -292,29 +292,17 @@ public class UnityRecieve_FACEMOTION3D_and_iFacialMocap : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 세로/가로 방향에 따른 BlendShape 보정 비율 적용
|
// 세로/가로 방향에 따른 BlendShape 보정 비율 적용
|
||||||
// 곡선 보정으로 0~100 범위를 유지하면서 민감도 조절
|
|
||||||
float ApplyScaleCorrection(string normalizedName, float weight)
|
float ApplyScaleCorrection(string normalizedName, float weight)
|
||||||
{
|
{
|
||||||
float scale = 1.0f;
|
|
||||||
|
|
||||||
if (VerticalBlendShapes.Contains(normalizedName))
|
if (VerticalBlendShapes.Contains(normalizedName))
|
||||||
{
|
{
|
||||||
scale = verticalScale;
|
return Mathf.Min(weight * verticalScale, 100f);
|
||||||
}
|
}
|
||||||
else if (HorizontalBlendShapes.Contains(normalizedName))
|
else if (HorizontalBlendShapes.Contains(normalizedName))
|
||||||
{
|
{
|
||||||
scale = horizontalScale;
|
return Mathf.Min(weight * horizontalScale, 100f);
|
||||||
}
|
}
|
||||||
|
return weight;
|
||||||
if (Mathf.Approximately(scale, 1.0f))
|
|
||||||
return weight;
|
|
||||||
|
|
||||||
// 0~100 범위 유지하면서 곡선 보정
|
|
||||||
// scale > 1: 작은 입력에서 더 빠르게 반응 (눌린 화면 보정)
|
|
||||||
// scale < 1: 작은 입력에서 더 느리게 반응
|
|
||||||
float normalized = weight / 100f;
|
|
||||||
float corrected = Mathf.Pow(normalized, 1f / scale);
|
|
||||||
return corrected * 100f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlendShape 이름 정규화 함수
|
// BlendShape 이름 정규화 함수
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user