Пример #1
0
        protected virtual void UpdateNose(Nose nose)
        {
            nose.top.target.transform.localPosition = HumanoidTarget.ToVector3(nose.top.target.position);

            nose.tip.target.transform.localPosition = HumanoidTarget.ToVector3(nose.tip.target.position);

            nose.bottomLeft.target.transform.localPosition  = HumanoidTarget.ToVector3(nose.bottomLeft.target.position);
            nose.bottom.target.transform.localPosition      = HumanoidTarget.ToVector3(nose.bottom.target.position);
            nose.bottomRight.target.transform.localPosition = HumanoidTarget.ToVector3(nose.bottomRight.target.position);
        }
Пример #2
0
        protected virtual void UpdateEyeBrows(FaceTarget face)
        {
            face.leftBrow.outer.target.transform.localPosition  = HumanoidTarget.ToVector3(face.leftBrow.outer.target.position);    // ==  kinectFace.leftBrow.outer.position
            face.leftBrow.center.target.transform.localPosition = HumanoidTarget.ToVector3(face.leftBrow.center.target.position);   // ==  kinectFace.leftBrow.outer.position
            face.leftBrow.inner.target.transform.localPosition  = HumanoidTarget.ToVector3(face.leftBrow.inner.target.position);    // ==  kinectFace.leftBrow.outer.position

            face.rightBrow.outer.target.transform.localPosition  = HumanoidTarget.ToVector3(face.rightBrow.outer.target.position);  // ==  kinectFace.leftBrow.outer.position
            face.rightBrow.center.target.transform.localPosition = HumanoidTarget.ToVector3(face.rightBrow.center.target.position); // ==  kinectFace.leftBrow.outer.position
            face.rightBrow.inner.target.transform.localPosition  = HumanoidTarget.ToVector3(face.rightBrow.inner.target.position);  // ==  kinectFace.leftBrow.outer.position
        }
Пример #3
0
        protected virtual void UpdateMouth(Mouth mouth)
        {
            mouth.upperLip.target.transform.localPosition      = HumanoidTarget.ToVector3(mouth.upperLip.target.position);
            mouth.upperLipLeft.target.transform.localPosition  = HumanoidTarget.ToVector3(mouth.upperLipLeft.target.position);
            mouth.upperLipRight.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.upperLipRight.target.position);

            mouth.lipLeft.target.transform.localPosition  = HumanoidTarget.ToVector3(mouth.lipLeft.target.position);
            mouth.lipRight.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.lipRight.target.position);

            mouth.lowerLip.target.transform.localPosition      = HumanoidTarget.ToVector3(mouth.lowerLip.target.position);
            mouth.lowerLipLeft.target.transform.localPosition  = HumanoidTarget.ToVector3(mouth.lowerLipLeft.target.position);
            mouth.lowerLipRight.target.transform.localPosition = HumanoidTarget.ToVector3(mouth.lowerLipRight.target.position);
        }
Пример #4
0
        protected virtual void UpdateUpperLeg(LegSensor legSensor)
        {
            if (footTarget.upperLeg.target.transform != null)
            {
                if (legSensor.upperLeg.confidence.position > 0)
                {
                    footTarget.upperLeg.target.transform.position = HumanoidTarget.ToVector3(legSensor.upperLeg.position);
                }
                //else
                // footTarget.upperLeg.target.transform.position = footTarget.shoulder.target.transform.position + footTarget.shoulder.target.transform.rotation * footTarget.outward * footTarget.shoulder.bone.length;

                if (legSensor.upperLeg.confidence.rotation > 0)
                {
                    footTarget.upperLeg.target.transform.rotation = HumanoidTarget.ToQuaternion(legSensor.upperLeg.rotation);
                }

                footTarget.upperLeg.target.confidence = legSensor.upperLeg.confidence;
            }
        }
Пример #5
0
        protected virtual void UpdateFoot(LegSensor legSensor)
        {
            if (footTarget.foot.target.transform != null)
            {
                if (legSensor.foot.confidence.position > 0)
                {
                    footTarget.foot.target.transform.position = HumanoidTarget.ToVector3(legSensor.foot.position);
                }
                else
                {
                    footTarget.foot.target.transform.position = footTarget.lowerLeg.target.transform.position + footTarget.lowerLeg.target.transform.rotation * Vector3.down * footTarget.lowerLeg.bone.length;
                }

                if (legSensor.foot.confidence.rotation > 0)
                {
                    footTarget.foot.target.transform.rotation = HumanoidTarget.ToQuaternion(legSensor.foot.rotation);
                }

                footTarget.foot.target.confidence = legSensor.foot.confidence;
            }
        }
Пример #6
0
 protected virtual void UpdateCheeks(FaceTarget face)
 {
     face.leftCheek.target.transform.localPosition  = HumanoidTarget.ToVector3(face.leftCheek.target.position);
     face.rightCheek.target.transform.localPosition = HumanoidTarget.ToVector3(face.rightCheek.target.position);
 }