NaoKinectTest.HumanModel.HumanSkeleton.HumanSkeleton C# (CSharp) Method

HumanSkeleton() public method

public HumanSkeleton ( JointsCollection kinectJoints ) : System
kinectJoints JointsCollection
return System
        public HumanSkeleton(JointsCollection kinectJoints)
        {
            this.kinectJoints = kinectJoints;
            Joint shoulderCenter = kinectJoints[JointID.ShoulderCenter];
            Joint spine = kinectJoints[JointID.Spine];
            leftShoulder = new HumanShoulder(shoulderCenter, spine,
                kinectJoints[JointID.ShoulderLeft],
                kinectJoints[JointID.ElbowLeft],
                kinectJoints[JointID.WristLeft], true);

            LeftShoulderPitch = leftShoulder.Pitch;
            LeftShoulderYaw = leftShoulder.Yaw;
            LeftShoulderRoll = leftShoulder.Roll;

            rightShoulder = new HumanShoulder(shoulderCenter, spine,
                kinectJoints[JointID.ShoulderRight],
                kinectJoints[JointID.ElbowRight],
                kinectJoints[JointID.WristRight], false);

            RightShoulderPitch = rightShoulder.Pitch;
            RightShoulderYaw = rightShoulder.Yaw;
            RightShoulderRoll = rightShoulder.Roll;

            leftElbow = new HumanElbow(
                kinectJoints[JointID.ShoulderLeft],
                kinectJoints[JointID.ElbowLeft],
                kinectJoints[JointID.WristLeft]);

            LeftElbowYaw = leftElbow.Yaw;

            rightElbow = new HumanElbow(
                kinectJoints[JointID.ShoulderRight],
                kinectJoints[JointID.ElbowRight],
                kinectJoints[JointID.WristRight]);

            RightElbowYaw = rightElbow.Yaw;
        }