예제 #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);
        }
예제 #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);
        }
예제 #3
0
파일: Model.cs 프로젝트: leha-bot/Mono.XNA
        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);
        }
예제 #4
0
 internal Enumerator(ModelMeshCollection collection)
 {
     this.collection = collection;
     position        = -1;
 }
예제 #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);
 }
예제 #6
0
 internal Enumerator(ModelMeshCollection collection)
 {
     _collection = collection;
     _position   = -1;
 }