public void AddChild(MdlObject o) { if (o.parent!=null) o.parent.RemoveChild(o); childs.Add(o); o.parent = this; }
public void RemoveChild(MdlObject o) { childs.Remove(o); o.parent = null; }
public void LinkToParent(MdlObject p) { if (parent!=null) UnlinkFromParent(); p.AddChild(this); }
public void MergeChild (MdlObject ch) { ch.RemoveTransform(true,true,true); PolyMesh pm = ch.PolyMesh; if (pm!=null) pm.MoveGeometry(GetOrCreatePolyMesh()); // move the childs foreach (MdlObject o in ch.childs) o.parent = this; childs.AddRange(ch.childs); ch.childs.Clear(); // delete the child RemoveChild(ch); }
public MdlObject Clone() { MdlObject cp = new MdlObject(); if (polyMesh != null) cp.polyMesh = polyMesh.Clone(); foreach (MdlObject o in childs) cp.AddChild(o.Clone()); cp.position = position; cp.rotation = rotation; cp.scale = scale; cp.name = name; return cp; }