xn::UserGenerator userGenerator; // initializing userGenerator XnUserID userID = 1; XnSkeletonJointPosition com; userGenerator.GetCoM(userID, com); // retrieving center of mass for user with ID 1
xn::UserGenerator userGenerator; // initializing userGenerator and checking for user calibration if (userGenerator.IsCapabilitySupported(XN_CAPABILITY_SKELETON) && userGenerator.GetNumberOfUsers() > 0) { XnSkeletonJointPosition com; userGenerator.GetCoM(userGenerator.GetUsers()[0], com); // retrieving center of mass for first user in the list }Package library: OpenNI.