コード例 #1
0
        protected Vector3D getCurrentJointValue(uint targetID, FubiUtils.SkeletonJoint jointID, FubiUtils.BodyMeasurement measureID = FubiUtils.BodyMeasurement.NUM_MEASUREMENTS)
        {
            float  x, y, z, confidence;
            double timeStamp;

            if (Type == XMLGenerator.RecognizerType.JointRelation || Type == XMLGenerator.RecognizerType.LinearMovement)
            {
                if (UseHand)
                {
                    Fubi.getCurrentHandJointPosition(targetID, (FubiUtils.SkeletonHandJoint)jointID, out x, out y, out z, out confidence, out timeStamp, Options.Local, Options.Filtered);
                }
                else
                {
                    Fubi.getCurrentSkeletonJointPosition(targetID, jointID, out x, out y, out z, out confidence, out timeStamp, Options.Local, Options.Filtered);
                    if (measureID != FubiUtils.BodyMeasurement.NUM_MEASUREMENTS && Type == XMLGenerator.RecognizerType.JointRelation)
                    {
                        float measureDist, measureConfidence;
                        Fubi.getBodyMeasurementDistance(targetID, measureID, out measureDist, out measureConfidence);
                        if (measureDist > 0)
                        {
                            x /= measureDist;
                            y /= measureDist;
                            z /= measureDist;
                        }
                    }
                }
            }
            else
            {
                var mat = new float[9];
                if (UseHand)
                {
                    Fubi.getCurrentHandJointOrientation(targetID, (FubiUtils.SkeletonHandJoint)jointID, mat, out confidence, out timeStamp, Options.Local, Options.Filtered);
                }
                else
                {
                    Fubi.getCurrentSkeletonJointOrientation(targetID, jointID, mat, out confidence, out timeStamp, Options.Local, Options.Filtered);
                }
                FubiUtils.Math.rotMatToRotation(mat, out x, out y, out z);
            }
            return(new Vector3D(x, y, z));
        }