I use the Kinect Toolbox, so I have a list ReplaySkeletonFramesin my hand. I repeat this list, getting the first tracked skeleton and changing some properties.
As we know, when changing an object, we also change the original object.
I need to make a copy of the skeleton.
Note. I can’t use CopySkeletonDataTo()it because my frame ReplaySkeletonFrame, not the ReplayFrame“normal” Kinect.
I tried to create my own method that copies a property by property, but some properties cannot be copied. look ...
public static Skeleton Clone(this Skeleton actualSkeleton)
{
if (actualSkeleton != null)
{
Skeleton newOne = new Skeleton();
newOne.Joints = actualSkeleton.Joints;
JointCollection jc = new JointCollection();
jc = actualSkeleton.Joints;
newOne.Joints = jc;
}
return newOne;
}
How to solve it?
source
share