UMD.HCIL.Piccolo.PNode.Reparent C# (CSharp) Method

Reparent() public method

Set the parent of this node, and transform the node in such a way that it doesn't move in global coordinates.
public Reparent ( PNode newParent ) : void
newParent PNode The new parent of this node.
return void
		public virtual void Reparent(PNode newParent) {
			PMatrix originalTransform = LocalToGlobalMatrix;
			PMatrix newTransform = newParent.GlobalToLocalMatrix;
			newTransform.Multiply(originalTransform);

			RemoveFromParent();
			Matrix = newTransform;
			newParent.AddChild(this);
			fullBoundsCache = ComputeFullBounds();
		}