Example #1
0
    private void UpdateRootData(int player)
    {
        OpenNI.SkeletonJointTransformation data;

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

        Vector3 newRootPosition = coordinateSystem.ConvertKinectPosition(data.Position.Position);

        newRootPosition = Vector3.Scale(newRootPosition, rootSpeedScaling);
        skeletons[player].root.position           = newRootPosition;
        skeletons[player].root.positionConfidence = data.Position.Confidence;
        skeletons[player].root.rotation           = coordinateSystem.ConvertKinectRotation(data.Orientation);
        skeletons[player].root.rotationConfidence = data.Orientation.Confidence;
    }