66
77namespace ETVRTrackingModule . ExpressionStrategies ;
88
9- public class V1Mapper : ImappingStategy
9+ public class V1Mapper : BaseParamMapper
1010{
1111 private Dictionary < string , float > _parameterValues = new ( )
1212 {
@@ -16,19 +16,12 @@ public class V1Mapper : ImappingStategy
1616 { "RightEyeX" , 0f } ,
1717 { "EyesY" , 0f } ,
1818 } ;
19+
20+ public V1Mapper ( ILogger logger , ref Config config ) : base ( logger , ref config ) { }
1921
20- private ILogger _logger ;
21- private readonly Config _config ;
22-
23- public V1Mapper ( ILogger logger , ref Config config )
24- {
25- _logger = logger ;
26- _config = config ;
27- }
28-
29- public void handleOSCMessage ( OSCMessage message )
22+ public override void handleOSCMessage ( OSCMessage message )
3023 {
31- var paramToMap = ImappingStategy . GetParamToMap ( message . address ) ;
24+ var paramToMap = GetParamToMap ( message . address ) ;
3225 if ( _parameterValues . ContainsKey ( paramToMap ) )
3326 {
3427 _parameterValues [ paramToMap ] = message . value ;
@@ -121,39 +114,4 @@ private void EmulateEyeBrows(ref UnifiedExpressionShape[] eyeShapes)
121114 _config . SqueezeThreshold
122115 ) ;
123116 }
124-
125- private void _emulateEyeBrow (
126- ref UnifiedExpressionShape [ ] eyeShapes ,
127- UnifiedExpressions eyebrowExpressionLowerrer ,
128- UnifiedExpressions eyebrowExpressionUpper ,
129- float baseEyeOpenness ,
130- float widenThreshold ,
131- float squeezeThreshold )
132- {
133- if ( ! _config . ShouldEmulateEyebrows )
134- return ;
135-
136- if ( baseEyeOpenness >= widenThreshold )
137- {
138- eyeShapes [ ( int ) eyebrowExpressionLowerrer ] . Weight = Utils . SmoothStep (
139- widenThreshold ,
140- 1 ,
141- baseEyeOpenness
142- ) ;
143- }
144-
145- if ( baseEyeOpenness <= squeezeThreshold )
146- {
147- eyeShapes [ ( int ) eyebrowExpressionUpper ] . Weight = Utils . SmoothStep (
148- squeezeThreshold ,
149- 1 ,
150- baseEyeOpenness
151- ) ;
152- eyeShapes [ ( int ) UnifiedExpressions . BrowLowererLeft ] . Weight = Utils . SmoothStep (
153- squeezeThreshold ,
154- 1 ,
155- baseEyeOpenness
156- ) ;
157- }
158- }
159117}
0 commit comments