public SmdFileV11 ToV11() { SmdFileV11 output; if (_Reference) { output = new SmdFileV11(SmdType.Reference); } else { output = new SmdFileV11(SmdType.Animation); } output.NodeCollection = _NodeCollection; output.TimeCollection = _TimeCollection; foreach (Triangle <VertexV10> triangle in _TriangleCollection) { Triangle <VertexV11> newtriangle = new Triangle <VertexV11>(); newtriangle.Texture = triangle.Texture; foreach (VertexV10 vertex in triangle.Vertices) { newtriangle.Vertices.Add(new VertexV11(new BlendV11[] { new BlendV11(vertex.Bone, 1.0000F), new BlendV11(-1, 0), new BlendV11(-1, 0), new BlendV11(-1, 0) }, vertex.Position, vertex.Normal, vertex.TextureCoordinate)); } output.TriangleCollection.Add(newtriangle); } return(output); }
public SmdFileV11 ToV11() { SmdFileV11 output; if (_Reference) { output = new SmdFileV11(SmdType.Reference); } else { output = new SmdFileV11(SmdType.Animation); } output.NodeCollection = _NodeCollection; output.TimeCollection = _TimeCollection; foreach (Triangle <VertexV44> triangle in _TriangleCollection) { Triangle <VertexV11> newtriangle = new Triangle <VertexV11>(); newtriangle.Texture = triangle.Texture; foreach (VertexV44 vertex in triangle.Vertices) { BlendV11[] blends = new BlendV11[4]; for (int i = 0; i < blends.Length; i++) { if (i > vertex.LinkCollection.Count - 1) { blends[i] = new BlendV11(); } else { blends[i] = new BlendV11(vertex.LinkCollection[i].Bone, vertex.LinkCollection[i].Weight); } } newtriangle.Vertices.Add(new VertexV11(blends, vertex.Position, vertex.Normal, vertex.TextureCoordinate)); } output.TriangleCollection.Add(newtriangle); } return(output); }