25 #ifndef INCLUDED_SkeletonConfig_h_GUID_A1D6BCE7_D044_4582_9BA5_860C790A3013 26 #define INCLUDED_SkeletonConfig_h_GUID_A1D6BCE7_D044_4582_9BA5_860C790A3013 29 #include <osvr/Client/Export.h> 56 typedef std::vector<std::pair<util::StringID, InternalInterfaceOwner>>
58 typedef std::vector<std::pair<util::StringID, OSVR_Pose3>> PoseMap;
62 : std::runtime_error(
"Client context is not yet initialized!") {}
68 "Could not find joint/bone Id with provided info!") {}
72 typedef unique_ptr<SkeletonConfig> SkeletonConfigPtr;
75 OSVR_CLIENT_EXPORT
static SkeletonConfigPtr
86 bool getBoneId(
const char *boneName,
88 bool getJointId(
const char *jointName,
109 void updateSkeletonPoses();
116 bool isSkeletonTreeUpdated()
const;
121 InterfaceMap m_jointInterfaces;
122 InterfaceMap m_boneInterfaces;
123 PoseMap m_jointPoses;
128 SkeletonConfig::getBoneId(
const char *boneName,
130 if (boneId ==
nullptr) {
137 *boneId =
id.value();
141 inline bool SkeletonConfig::getAvailableJointId(
144 if (jointId ==
nullptr) {
148 if (jointIndex >= m_jointInterfaces.size()) {
157 m_jointMap.getStringFromId(m_jointInterfaces[jointIndex].first);
160 auto ret = getJointId(stringId.c_str(), jointId);
168 if (boneId ==
nullptr) {
172 if (boneIndex >= m_boneMap.getEntries().size()) {
176 auto boneName = m_boneMap.getEntries().at(boneIndex);
178 auto ret = getBoneId(boneName.c_str(), boneId);
184 SkeletonConfig::getJointId(
const char *jointName,
186 if (jointId ==
nullptr) {
193 *jointId =
id.value();
201 for (
auto val : m_jointPoses) {
202 if (val.first.value() == jointId) {
216 for (
auto val : m_bonePoses) {
217 if (val.first.value() == boneId) {
228 m_boneMap.getEntries().size());
233 m_jointMap.getEntries().size());
238 auto boneName = m_boneMap.getStringFromId(
util::StringID(boneId));
239 if (boneName.empty()) {
246 auto jointName = m_jointMap.getStringFromId(
util::StringID(jointId));
247 if (jointName.empty()) {
255 #endif // INCLUDED_SkeletonConfig_h_GUID_A1D6BCE7_D044_4582_9BA5_860C790A3013 OSVR_Pose3 getBoneState(OSVR_SkeletonBoneCount boneId) const
Definition: SkeletonConfig.h:212
Centralize a string registry.
Definition: RegisteredStringMap.h:43
Definition: ViewerEye.h:57
A tree representation, with path/url syntax, of the known OSVR system.
Definition: PathTree.h:43
Header declaring opaque types used by Client and ClientKit.
Header providing a class template suitable for inheritance that wraps an arbitrary STL-like container...
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
uint32_t OSVR_SkeletonBoneCount
integer type specifying bone count/index(Id)
Definition: ClientReportTypesC.h:348
Definition: SkeletonConfig.h:65
Header to bring unique_ptr into the osvr namespace.
Definition: TypeSafeId.h:41
Definition: SkeletonConfig.h:80
Definition: SkeletonConfig.h:73
Header providing a C++ wrapper around TimeValueC.h.
Definition: ClientContext.h:50
A structure defining a 3D (6DOF) rigid body pose: translation and rotation.
Definition: Pose3C.h:54
Definition: SkeletonConfig.h:60
uint32_t OSVR_SkeletonJointCount
integer type specifying joint count/index(Id)
Definition: ClientReportTypesC.h:345