From 08efedbab99d8a8b62158e0f52deba646acc31b2 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 26 Sep 2018 20:42:55 +0900 Subject: [PATCH] VRMLookAtBlendShapeApplyer limit to 1.0 --- Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs b/Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs index f3c24da55..165adf182 100644 --- a/Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs +++ b/Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs @@ -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 }