public odfSubmesh Clone() { odfSubmesh newSubmesh = new odfSubmesh(Name, Id, _FormatType); newSubmesh.Unknown1 = Unknown1; newSubmesh.AlwaysZero1 = (byte[])AlwaysZero1.Clone(); newSubmesh.MaterialId = new ObjectID(MaterialId); newSubmesh.TextureIds = (ObjectID[])TextureIds.Clone(); newSubmesh.AlwaysZero2 = (byte[])AlwaysZero2.Clone(); newSubmesh.Unknown4 = Unknown4; newSubmesh.Unknown5 = Unknown5; newSubmesh.Unknown6 = Unknown6; if (AlwaysZero3 != null) { newSubmesh.AlwaysZero3 = (byte[])AlwaysZero3.Clone(); } newSubmesh.Unknown7 = Unknown7; newSubmesh.Unknown8 = (byte[])Unknown8.Clone(); newSubmesh.VertexList = new List <odfVertex>(NumVertices); foreach (odfVertex vert in VertexList) { newSubmesh.VertexList.Add(vert.Clone()); } newSubmesh.FaceList = new List <odfFace>(NumVertexIndices / 3); foreach (odfFace face in FaceList) { newSubmesh.FaceList.Add(face.Clone()); } newSubmesh.AlwaysZero4 = (byte[])AlwaysZero4.Clone(); return(newSubmesh); }
public odfFrame Clone(bool mesh, List <ObjectID> meshIDs, bool childFrames) { odfFrame frame = new odfFrame(new ObjectName(Name.Name, Name.Info), new ObjectID(Id), Count); frame.Parent = Parent; frame.ParentId = new ObjectID(ParentId); frame.Matrix = Matrix; frame.AlwaysZero1 = (byte[])AlwaysZero1.Clone(); frame.AlwaysZero2 = (byte[])AlwaysZero2.Clone(); frame.Unknown3 = Unknown3; frame.Unknown4 = (float[])Unknown4.Clone(); frame.Unknown5 = Unknown5; frame.Unknown6 = Unknown6; frame.AlwaysZero7 = (byte[])AlwaysZero7.Clone(); frame.Unknown8 = Unknown8; frame.AlwaysZero9 = (byte[])AlwaysZero9.Clone(); frame.Unknown10 = Unknown10; frame.AlwaysZero11 = (byte[])AlwaysZero11.Clone(); frame.Unknown12 = Unknown12; if (mesh && (int)MeshId != 0) { frame.MeshId = new ObjectID(MeshId); meshIDs.Add(MeshId); } else { frame.MeshId = ObjectID.INVALID; } if (childFrames) { for (int i = 0; i < children.Count; i++) { frame.AddChild(children[i].Clone(mesh, meshIDs, true)); } } return(frame); }