예제 #1
0
		public void AddChild(MdlObject o)
		{
			if (o.parent!=null)
				o.parent.RemoveChild(o);

			childs.Add(o);
			o.parent = this;
		}
예제 #2
0
		public void RemoveChild(MdlObject o)
		{
			childs.Remove(o);
			o.parent = null;
		}
예제 #3
0
		public void LinkToParent(MdlObject p)
		{
			if (parent!=null) 
				UnlinkFromParent();

			p.AddChild(this);
		}
예제 #4
0
		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);
		}
예제 #5
0
		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;
		}