xn::UserGenerator userGenerator; if (userGenerator.IsCapabilitySupported(XN_CAPABILITY_SKELETON)) { // Skeleton tracking is supported! Proceed with skeleton tracking code. } else { // Skeleton tracking is not supported on this device. Display an error message. std::cerr << "Error: Skeleton tracking not supported." << std::endl; }
xn::UserGenerator userGenerator; if (userGenerator.IsCapabilitySupported(XN_CAPABILITY_GESTURE)) { // Gesture recognition is supported! Proceed with gesture recognition code. } else { // Gesture recognition is not supported on this device. Display an error message. std::cerr << "Error: Gesture recognition not supported." << std::endl; }Brief Examples: 1. The first code example shows how the IsCapabilitySupported method can be used to check whether a device supports skeleton tracking, which is a common feature used in Kinect-style games and applications. 2. The second example shows how the same method can be used to check for gesture recognition capabilities, which could be useful in controlling user interfaces or other interactive experiences. Package Library: OpenNI.