@@ -462,7 +462,7 @@ bool CRTProtocol::StreamFrames(EStreamRate eRate, unsigned int nRateArg, unsigne
462
462
463
463
if (eRate == RateFrequencyDivisor)
464
464
{
465
- commandString << " StreamFrames FrequencyDivisor: " << nRateArg << " " ;
465
+ commandString << " StreamFrames FrequencyDivisor:" << nRateArg << " " ;
466
466
}
467
467
else if (eRate == RateFrequency)
468
468
{
@@ -4084,6 +4084,8 @@ bool CRTProtocol::ReadSkeletonSettings(bool &dataAvailable, bool skeletonGlobalD
4084
4084
return false ;
4085
4085
}
4086
4086
4087
+ int segmentIndex;
4088
+ std::map<int , int > segmentIdIndexMap;
4087
4089
xml.ResetPos ();
4088
4090
4089
4091
xml.FindElem ();
@@ -4099,6 +4101,7 @@ bool CRTProtocol::ReadSkeletonSettings(bool &dataAvailable, bool skeletonGlobalD
4099
4101
{
4100
4102
SSettingsSkeletonHierarchical skeletonHierarchical;
4101
4103
SSettingsSkeleton skeleton;
4104
+ segmentIndex = 0 ;
4102
4105
4103
4106
skeletonHierarchical.name = xml.GetAttrib (" Name" );
4104
4107
skeleton.name = skeletonHierarchical.name ;
@@ -4129,6 +4132,8 @@ bool CRTProtocol::ReadSkeletonSettings(bool &dataAvailable, bool skeletonGlobalD
4129
4132
segmentHierarchical.name = xml.GetAttrib (" Name" );
4130
4133
ParseString (xml.GetAttrib (" ID" ), segmentHierarchical.id );
4131
4134
4135
+ segmentIdIndexMap[segmentHierarchical.id ] = segmentIndex++;
4136
+
4132
4137
xml.IntoElem ();
4133
4138
4134
4139
if (xml.FindElem (" Transform" ))
@@ -4223,15 +4228,14 @@ bool CRTProtocol::ReadSkeletonSettings(bool &dataAvailable, bool skeletonGlobalD
4223
4228
segment.name = segmentHierarchical.name ;
4224
4229
segment.id = segmentHierarchical.id ;
4225
4230
segment.parentId = parentId;
4226
- segment.parentIndex = segments.size () - 1 ;
4227
- segment.positionX = (float )segmentHierarchical.position .x ;
4228
- segment.positionX = (float )segmentHierarchical.position .x ;
4229
- segment.positionY = (float )segmentHierarchical.position .y ;
4230
- segment.positionZ = (float )segmentHierarchical.position .z ;
4231
- segment.rotationX = (float )segmentHierarchical.rotation .x ;
4232
- segment.rotationY = (float )segmentHierarchical.rotation .y ;
4233
- segment.rotationZ = (float )segmentHierarchical.rotation .z ;
4234
- segment.rotationW = (float )segmentHierarchical.rotation .w ;
4231
+ segment.parentIndex = (parentId != -1 ) ? segmentIdIndexMap[parentId] : -1 ;
4232
+ segment.positionX = (float )segmentHierarchical.defaultPosition .x ;
4233
+ segment.positionY = (float )segmentHierarchical.defaultPosition .y ;
4234
+ segment.positionZ = (float )segmentHierarchical.defaultPosition .z ;
4235
+ segment.rotationX = (float )segmentHierarchical.defaultRotation .x ;
4236
+ segment.rotationY = (float )segmentHierarchical.defaultRotation .y ;
4237
+ segment.rotationZ = (float )segmentHierarchical.defaultRotation .z ;
4238
+ segment.rotationW = (float )segmentHierarchical.defaultRotation .w ;
4235
4239
4236
4240
segments.push_back (segment);
4237
4241
@@ -4258,9 +4262,6 @@ bool CRTProtocol::ReadSkeletonSettings(bool &dataAvailable, bool skeletonGlobalD
4258
4262
}
4259
4263
else
4260
4264
{
4261
- int segmentIndex;
4262
- std::map<int , int > segmentIdIndexMap;
4263
-
4264
4265
while (xml.FindElem (" Skeleton" ))
4265
4266
{
4266
4267
SSettingsSkeleton skeleton;
0 commit comments