public bool MorphToExistingObject(PhysicsPart template) { GfxObj = template.GfxObj; // TODO: deep copy var scale = new Vector3(template.GfxObjScale.X, template.GfxObjScale.Y, template.GfxObjScale.Z); Pos.ObjCellID = template.Pos.ObjCellID; // frame copy constructor? Pos.Frame = template.Pos.Frame; DrawPos.ObjCellID = template.DrawPos.ObjCellID; DrawPos.Frame = template.DrawPos.Frame; OriginalPaletteID = template.OriginalPaletteID; // removed surfaces return(true); }
public bool MorphToExistingObject(PartArray obj) { DestroyParts(); Setup = obj.Setup; // add reference? Scale = new Vector3(obj.Scale.X, obj.Scale.Y, obj.Scale.Z); NumParts = obj.NumParts; Parts = new List <PhysicsPart>((int)obj.NumParts); InitPals(); for (var i = 0; i < NumParts; i++) { Parts[i] = PhysicsPart.MakePhysicsPart(obj.Parts[i]); Parts[i].PhysObj = Owner; Parts[i].PhysObjIndex = i; // removed palette references } return(true); }