mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-11 04:54:17 -05:00
VRMLookAtBlendShapeApplyer limit to 1.0
This commit is contained in:
parent
c5ee83f5b9
commit
08efedbab9
|
|
@ -50,26 +50,26 @@ namespace VRM
|
|||
{
|
||||
// Left
|
||||
m_propxy.SetValue(BlendShapePreset.LookRight, 0, !m_notSetValueApply); // clear first
|
||||
m_propxy.SetValue(BlendShapePreset.LookLeft, Horizontal.Map(-yaw), !m_notSetValueApply);
|
||||
m_propxy.SetValue(BlendShapePreset.LookLeft, Mathf.Clamp(Horizontal.Map(-yaw), 0, 1.0f), !m_notSetValueApply);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Right
|
||||
m_propxy.SetValue(BlendShapePreset.LookLeft, 0, !m_notSetValueApply); // clear first
|
||||
m_propxy.SetValue(BlendShapePreset.LookRight, Horizontal.Map(yaw), !m_notSetValueApply);
|
||||
m_propxy.SetValue(BlendShapePreset.LookRight, Mathf.Clamp(Horizontal.Map(yaw), 0, 1.0f), !m_notSetValueApply);
|
||||
}
|
||||
|
||||
if (pitch < 0)
|
||||
{
|
||||
// Down
|
||||
m_propxy.SetValue(BlendShapePreset.LookUp, 0, !m_notSetValueApply); // clear first
|
||||
m_propxy.SetValue(BlendShapePreset.LookDown, VerticalDown.Map(-pitch), !m_notSetValueApply);
|
||||
m_propxy.SetValue(BlendShapePreset.LookDown, Mathf.Clamp(VerticalDown.Map(-pitch), 0, 1.0f), !m_notSetValueApply);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Up
|
||||
m_propxy.SetValue(BlendShapePreset.LookDown, 0, !m_notSetValueApply); // clear first
|
||||
m_propxy.SetValue(BlendShapePreset.LookUp, VerticalUp.Map(pitch), !m_notSetValueApply);
|
||||
m_propxy.SetValue(BlendShapePreset.LookUp, Mathf.Clamp(VerticalUp.Map(pitch), 0, 1.0f), !m_notSetValueApply);
|
||||
}
|
||||
#pragma warning restore 0618
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user