Ejemplo n.º 1
0
        public Model(GraphicsDevice graphicsDevice, List <ModelBone> bones, List <ModelMesh> meshes)
        {
            // TODO: Complete member initialization
            this.graphicsDevice = graphicsDevice;

            Bones  = new ModelBoneCollection(bones);
            Meshes = new ModelMeshCollection(meshes);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a model.
        /// </summary>
        /// <param name="graphicsDevice">A valid reference to <see cref="GraphicsDevice"/>.</param>
        /// <param name="bones">The collection of bones.</param>
        /// <param name="meshes">The collection of meshes.</param>
        public Model(GraphicsDevice graphicsDevice, List <ModelBone> bones, List <ModelMesh> meshes)
        {
            if (graphicsDevice == null)
            {
                throw new ArgumentNullException("graphicsDevice");
            }

            // TODO: Complete member initialization
            this.graphicsDevice = graphicsDevice;

            Bones  = new ModelBoneCollection(bones);
            Meshes = new ModelMeshCollection(meshes);
        }
Ejemplo n.º 3
0
        private void ReadMeshes(ContentReader input, VertexDeclaration[] vertexDeclarations)
        {
            int length = input.ReadInt32();

            ModelMesh[] meshes = new ModelMesh[length];
            for (int i = 0; i < length; i++)
            {
                string         name           = input.ReadObject <string>();
                ModelBone      parentBone     = this.ReadBoneReference(input);
                BoundingSphere boundingSphere = new BoundingSphere();
                boundingSphere.Center = input.ReadVector3();
                boundingSphere.Radius = input.ReadSingle();
                VertexBuffer    vertexBuffer = input.ReadObject <VertexBuffer>();
                IndexBuffer     indexBuffer  = input.ReadObject <IndexBuffer>();
                object          tag          = input.ReadObject <object>();
                ModelMeshPart[] meshParts    = ReadMeshParts(input, vertexBuffer, indexBuffer, vertexDeclarations);
                meshes[i] = new ModelMesh(name, parentBone, boundingSphere, vertexBuffer, indexBuffer, meshParts, tag);
            }
            this.meshes = new ModelMeshCollection(meshes);
        }
Ejemplo n.º 4
0
 internal Enumerator(ModelMeshCollection collection)
 {
     this.collection = collection;
     position        = -1;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Constructs a model.
 /// </summary>
 /// <param name="graphicsDevice">A valid reference to <see cref="GraphicsDevice"/>.</param>
 /// <param name="bones">The collection of bones.</param>
 /// <param name="meshes">The collection of meshes.</param>
 internal Model(GraphicsDevice graphicsDevice, List <ModelBone> bones, List <ModelMesh> meshes)
 {
     Bones  = new ModelBoneCollection(bones);
     Meshes = new ModelMeshCollection(meshes);
 }
Ejemplo n.º 6
0
 internal Enumerator(ModelMeshCollection collection)
 {
     _collection = collection;
     _position   = -1;
 }