Exemple #1
0
    /*
     *  Kinect 1 functions
     */
    private void UpdateKinectRootData(int player)
    {
        OpenNI.SkeletonJointTransformation data;

        if (!playerManager.GetPlayer(player).GetSkeletonJoint(OpenNI.SkeletonJoint.Torso, out data))
        {
            return;
        }

        Vector3 newRootPosition = coordinateSystem.ConvertLocation(coordinateSystem.ConvertRawKinectLocation(data.Position.Position), RUISDevice.Kinect_1);

        skeletons[kinect1SensorID, player].root.position           = newRootPosition;
        skeletons[kinect1SensorID, player].root.positionConfidence = data.Position.Confidence;
        skeletons[kinect1SensorID, player].root.rotation           = coordinateSystem.ConvertRotation(coordinateSystem.ConvertRawKinectRotation(data.Orientation), RUISDevice.Kinect_1);


        skeletons[kinect1SensorID, player].root.rotationConfidence = data.Orientation.Confidence;
    }