コード例 #1
0
 private void NaivelyAndIneffecientlyCheckForChangedExpression(SCNNode node, ARBlendShapeLocationOptions blendShapes)
 {
     if (blendShapes.BrowInnerUp > .6)
     {
         BounceStuff(blendShapes.BrowInnerUp.Value * 3);
     }
 }
コード例 #2
0
ファイル: Extensions.cs プロジェクト: NickSpag/iTracker
        public static void SetBlendingShapes(this IGazeSnapshot snapshot, ARBlendShapeLocationOptions shapes)
        {
            snapshot.BrowDownLeft     = (double)shapes.BrowDownLeft;
            snapshot.BrowDownRight    = (double)shapes.BrowDownRight;
            snapshot.BrowInnerUp      = (double)shapes.BrowInnerUp;
            snapshot.BrowOuterUpLeft  = (double)shapes.BrowOuterUpLeft;
            snapshot.BrowOuterUpRight = (double)shapes.BrowOuterUpRight;

            snapshot.CheekPuff        = (double)shapes.CheekPuff;
            snapshot.CheekSquintLeft  = (double)shapes.CheekSquintLeft;
            snapshot.CheekSquintRight = (double)shapes.CheekSquintRight;

            snapshot.EyeBlinkLeft     = (double)shapes.EyeBlinkLeft;
            snapshot.EyeBlinkRight    = (double)shapes.EyeBlinkRight;
            snapshot.EyeLookDownLeft  = (double)shapes.EyeLookDownLeft;
            snapshot.EyeLookDownRight = (double)shapes.EyeLookDownRight;
            snapshot.EyeLookInLeft    = (double)shapes.EyeLookInLeft;
            snapshot.EyeLookInRight   = (double)shapes.EyeLookInRight;
            snapshot.EyeLookOutLeft   = (double)shapes.EyeLookOutLeft;
            snapshot.EyeLookOutRight  = (double)shapes.EyeLookOutRight;
            snapshot.EyeLookUpLeft    = (double)shapes.EyeLookUpLeft;
            snapshot.EyeLookUpRight   = (double)shapes.EyeLookUpRight;
            snapshot.EyeSquintLeft    = (double)shapes.EyeSquintLeft;
            snapshot.EyeSquintRight   = (double)shapes.EyeSquintRight;
            snapshot.EyeWideLeft      = (double)shapes.EyeWideLeft;
            snapshot.EyeWideRight     = (double)shapes.EyeWideRight;

            snapshot.JawForward = (double)shapes.JawForward;
            snapshot.JawLeft    = (double)shapes.JawLeft;
            snapshot.JawOpen    = (double)shapes.JawOpen;
            snapshot.JawRight   = (double)shapes.JawRight;

            snapshot.MouthClose          = (double)shapes.MouthClose;
            snapshot.MouthDimpleLeft     = (double)shapes.MouthDimpleLeft;
            snapshot.MouthDimpleRight    = (double)shapes.MouthDimpleRight;
            snapshot.MouthFrownLeft      = (double)shapes.MouthFrownLeft;
            snapshot.MouthFrownRight     = (double)shapes.MouthFrownRight;
            snapshot.MouthFunnel         = (double)shapes.MouthFunnel;
            snapshot.MouthLeft           = (double)shapes.MouthLeft;
            snapshot.MouthLowerDownLeft  = (double)shapes.MouthLowerDownLeft;
            snapshot.MouthLowerDownRight = (double)shapes.MouthLowerDownRight;
            snapshot.MouthPressLeft      = (double)shapes.MouthPressLeft;
            snapshot.MouthPressRight     = (double)shapes.MouthPressRight;
            snapshot.MouthPucker         = (double)shapes.MouthPucker;
            snapshot.MouthRight          = (double)shapes.MouthRight;
            snapshot.MouthRollLower      = (double)shapes.MouthRollLower;
            snapshot.MouthRollUpper      = (double)shapes.MouthRollUpper;
            snapshot.MouthShrugLower     = (double)shapes.MouthShrugLower;
            snapshot.MouthShrugUpper     = (double)shapes.MouthShrugUpper;
            snapshot.MouthSmileLeft      = (double)shapes.MouthSmileLeft;
            snapshot.MouthSmileRight     = (double)shapes.MouthSmileRight;
            snapshot.MouthStretchLeft    = (double)shapes.MouthStretchLeft;
            snapshot.MouthStretchRight   = (double)shapes.MouthStretchRight;
            snapshot.MouthUpperUpLeft    = (double)shapes.MouthUpperUpLeft;
            snapshot.MouthUpperUpRight   = (double)shapes.MouthUpperUpRight;

            snapshot.NoseSneerLeft  = (double)shapes.NoseSneerLeft;
            snapshot.NoseSneerRight = (double)shapes.NoseSneerRight;
        }
コード例 #3
0
 public static Dictionary <string, float?> ToDictionary(this ARBlendShapeLocationOptions self)
 {
     return(new Dictionary <string, float?>()
     {
         { "BrowDownLeft", self.BrowDownLeft },
         { "BrowDownRight", self.BrowDownRight },
         { "BrowInnerUp", self.BrowInnerUp },
         { "BrowOuterUpLeft", self.BrowOuterUpLeft },
         { "BrowOuterUpRight", self.BrowOuterUpRight },
         { "CheekPuff", self.CheekPuff },
         { "CheekSquintLeft", self.CheekSquintLeft },
         { "CheekSquintRight", self.CheekSquintRight },
         { "EyeBlinkLeft", self.EyeBlinkLeft },
         { "EyeBlinkRight", self.EyeBlinkRight },
         { "EyeLookDownLeft", self.EyeLookDownLeft },
         { "EyeLookDownRight", self.EyeLookDownRight },
         { "EyeLookInLeft", self.EyeLookInLeft },
         { "EyeLookInRight", self.EyeLookInRight },
         { "EyeLookOutLeft", self.EyeLookOutLeft },
         { "EyeLookOutRight", self.EyeLookOutRight },
         { "EyeLookUpLeft", self.EyeLookUpLeft },
         { "EyeLookUpRight", self.EyeLookUpRight },
         { "EyeSquintLeft", self.EyeSquintLeft },
         { "EyeSquintRight", self.EyeSquintRight },
         { "EyeWideLeft", self.EyeWideLeft },
         { "EyeWideRight", self.EyeWideRight },
         { "JawForward", self.JawForward },
         { "JawLeft", self.JawLeft },
         { "JawOpen", self.JawOpen },
         { "JawRight", self.JawRight },
         { "MouthClose", self.MouthClose },
         { "MouthDimpleLeft", self.MouthDimpleLeft },
         { "MouthDimpleRight", self.MouthDimpleRight },
         { "MouthFrownLeft", self.MouthFrownLeft },
         { "MouthFrownRight", self.MouthFrownRight },
         { "MouthFunnel", self.MouthFunnel },
         { "MouthLeft", self.MouthLeft },
         { "MouthLowerDownLeft", self.MouthLowerDownLeft },
         { "MouthLowerDownRight", self.MouthLowerDownRight },
         { "MouthPressLeft", self.MouthPressLeft },
         { "MouthPressRight", self.MouthPressRight },
         { "MouthPucker", self.MouthPucker },
         { "MouthRight", self.MouthRight },
         { "MouthRollLower", self.MouthRollLower },
         { "MouthRollUpper", self.MouthRollUpper },
         { "MouthShrugLower", self.MouthShrugLower },
         { "MouthShrugUpper", self.MouthShrugUpper },
         { "MouthSmileLeft", self.MouthSmileLeft },
         { "MouthSmileRight", self.MouthSmileRight },
         { "MouthStretchLeft", self.MouthStretchLeft },
         { "MouthStretchRight", self.MouthStretchRight },
         { "MouthUpperUpLeft", self.MouthUpperUpLeft },
         { "MouthUpperUpRight", self.MouthUpperUpRight },
         { "NoseSneerLeft", self.NoseSneerLeft },
         { "NoseSneerRight", self.NoseSneerRight },
         { "TongueOut", self.TongueOut }
     });
 }
コード例 #4
0
        private void NaivelyAndIneffecientlyCheckForChangedExpression(SCNNode node, ARBlendShapeLocationOptions blendShapes)
        {
            if (_lastBlendShapes == null)
            {
                _lastBlendShapes = blendShapes;
            }

            // mouth wide open WOW
            if (blendShapes.JawOpen > .85 && _lastBlendShapes.JawOpen <= .85)
            {
                SoundManager.PlaySound("wow");
            }

            // blink
            var currBlink = Math.Max((double)blendShapes.EyeBlinkLeft, (double)blendShapes.EyeBlinkRight);
            var lastBlink = Math.Max((double)_lastBlendShapes.EyeBlinkLeft, (double)blendShapes.EyeBlinkRight);

            if (currBlink > .85 && lastBlink <= .85)
            {
                SoundManager.PlaySound("miss");
            }

            // smile
            if (blendShapes.MouthSmileRight > .9 && _lastBlendShapes.MouthSmileRight <= .9)
            {
                SoundManager.PlaySound("eb_newchar");
                AddOrbitingNode(node);
            }

            // frowny looking face
            if (Math.Max((double)blendShapes.BrowDownLeft, (double)blendShapes.BrowDownRight) > .7 &&
                Math.Max((double)_lastBlendShapes.BrowDownLeft, (double)_lastBlendShapes.BrowDownRight) <= .7)
            {
                SoundManager.PlaySound("eb_behind");
            }

            _lastBlendShapes = blendShapes;
        }