AvatarController.RotateToCalibrationPose C# (CSharp) Method

RotateToCalibrationPose() public method

public RotateToCalibrationPose ( uint userId, bool needCalibration ) : void
userId uint
needCalibration bool
return void
    public void RotateToCalibrationPose(uint userId, bool needCalibration)
    {
        // Reset the rest of the model to the original position.
        RotateToInitialPosition();

        if(needCalibration)
        {
            if(offsetNode != null)
            {
                // Set the offset's rotation to 0.
                offsetNode.transform.rotation = Quaternion.Euler(Vector3.zero);
            }

            // Right Elbow
            if(RightElbow != null)
                RightElbow.rotation = Quaternion.Euler(0, -90, 90) *
                    initialRotations[(int)KinectWrapper.SkeletonJoint.RIGHT_ELBOW];

            // Left Elbow
            if(LeftElbow != null)
                LeftElbow.rotation = Quaternion.Euler(0, 90, -90) *
                    initialRotations[(int)KinectWrapper.SkeletonJoint.LEFT_ELBOW];

            if(offsetNode != null)
            {
                // Restore the offset's rotation
                offsetNode.transform.rotation = originalRotation;
            }
        }
    }