The building blocks – Joints and JointCollection
Joints
and JointCollection
are the building blocks of Skeleton
. Each Skeleton
object has a property named Joints
, which is a type of
JointCollection
and contains all the traceable joints. JointCollecton
contains a set of Joints
and can be accessed by specifying the index value. When you pass JointType
to get the Joint
point, it will return the Joint
object.
Let's consider you have an object of a tracked skeleton as follows:
Skeleton skeleton = (from trackskeleton in totalSkeleton where trackskeleton.TrackingState == SkeletonTrackingState.Tracked select trackskeleton).FirstOrDefault();
In the previous code, the skeleton
object now contains Joints
in the form of JointCollection
. Now to get the reference of a particular joint type, you need to pass the type within the collection as shown in the following example for the Head JointType
:
Joint headJoint= skeleton.Joints[JointType.Head]);
headJoint
now refers to HeadJoint
of the skeleton
object, with...