コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AvatarPose"/> class for the given skeleton.
        /// </summary>
        /// <param name="skeleton">The skeleton.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="skeleton"/> is <see langword="null"/>.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// <paramref name="skeleton"/> is not a valid Xbox LIVE Avatar skeleton.
        /// </exception>
        public AvatarPose(Skeleton skeleton)
        {
            if (skeleton.NumberOfBones != AvatarRenderer.BoneCount)
            {
                throw new ArgumentException("The specified skeleton is not a valid Avatar skeleton.", "skeleton");
            }

            _expressionWrapper = new DelegateAnimatableProperty <AvatarExpression>(
                () => _expression,     // Getter
                e => _expression = e); // Setter

            _skeletonPose = SkeletonPose.Create(skeleton);
        }