private void ReadBones(ContentReader input) { ModelBone[] bones = new ModelBone[input.ReadInt32()]; for (int i = 0; i < bones.Length; i++) { string name = input.ReadObject <string>(); Matrix transform = input.ReadMatrix(); bones[i] = new ModelBone(i, name, transform); } this.bones = new ModelBoneCollection(bones); foreach (ModelBone bone in bones) { ModelBone newParent = this.ReadBoneReference(input); int size = input.ReadInt32(); ModelBone[] newChildren = new ModelBone[size]; for (int j = 0; j < size; j++) { newChildren[j] = this.ReadBoneReference(input); } bone.SetParentChildren(newParent, newChildren); } }
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); }
/// <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); }
internal Enumerator(ModelBoneCollection collection) { this.collection = collection; position = -1; }
/// <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); }
public ModelBone() { Children = new ModelBoneCollection(new List <ModelBone>()); meshes = new List <ModelMesh>(); }
internal void AddChild(ModelBone modelBone) { children.Add(modelBone); Children = new ModelBoneCollection(children); }
internal void SetParentChildren(ModelBone Parent, ModelBone[] Children) { this.parent = Parent; this.children = new ModelBoneCollection(Children); }
internal Enumerator(ModelBoneCollection collection) { _collection = collection; _position = -1; }