private void MergeIntoBranch(IAABBNode myNewNode, IAABBNode currentObject) { IAABBNode myNewBranch = new AABBStaticNode(); myNewBranch.Bounds = BoundingBox.CreateMerged(myNewNode.Bounds, currentObject.Bounds); myNewBranch.Left = currentObject; myNewBranch.DepthOffset = currentObject.DepthOffset; currentObject.DepthOffset--; myNewBranch.Right = myNewNode; //Depth Offset = 0; myNewNode.Parent = myNewBranch; if (currentObject.Parent == null) { Root = myNewBranch; } else if (currentObject.Parent.Right == currentObject) { currentObject.Parent.Right = myNewBranch; } else if (currentObject.Parent.Left == currentObject) { currentObject.Parent.Left = myNewBranch; } myNewBranch.Parent = currentObject.Parent; currentObject.Parent = myNewBranch; }
internal void RemoveIfRoot(AABBStaticNode aABBStaticNode) { throw new NotImplementedException(); }