Example #1
0
        /// <summary></summary>
        public AvatarAnimationData(string name, MeshData[] meshes, SkeletonData skeleton, AnimationData[] animations)
        {
            this.name       = name;
            this.skeleton   = skeleton;
            this.animations = animations;

            GeometryBounds[] bounds = new GeometryBounds[meshes.Length];
            for (int i = 0; i < bounds.Length; i++)
            {
                bounds[i] = meshes[i].staticBounds;
            }

            this.staticBounds = new GeometryBounds(bounds);

            this.animationStaticBounds = new GeometryBounds[animations.Length];
            for (int i = 0; i < animations.Length; i++)
            {
                GeometryBounds[] children = new GeometryBounds[meshes.Length];
                for (int n = 0; n < meshes.Length; n++)
                {
                    children[n] = meshes[n].AnimationStaticBoundsOffset[i];
                }
                this.animationStaticBounds[i] = new GeometryBounds(this.staticBounds, children);
            }
        }
Example #2
0
        internal AvatarAnimationData(ContentReader reader)
        {
            int fileVersion = reader.ReadInt32();

            if (version != fileVersion)
            {
                throw new InvalidOperationException("Serialiezd AvatarAnimationData version mismatch");
            }
            this.name = string.Intern(reader.ReadString());

            this.skeleton = new SkeletonData(reader, true);

            int count = reader.ReadInt32();

            this.animations = new AnimationData[count];
            for (int i = 0; i < count; i++)
            {
                this.animations[i] = new AnimationData(reader, i);
            }

            this.staticBounds = new GeometryBounds(reader);

            count = (int)reader.ReadInt16();
            animationStaticBounds = new GeometryBounds[count];
            for (int i = 0; i < animationStaticBounds.Length; i++)
            {
                animationStaticBounds[i] = new GeometryBounds(reader);
            }
        }