public void Unlink() { if (this.Disposed == true) { throw new ObjectDisposedException("idClipModel"); } ClipLink link = null; while (link != null) { if (link.PreviousInSector != null) { link.PreviousInSector.NextInSector = link.NextInSector; } else { link.Sector.Links = link.NextInSector; } if (link.NextInSector != null) { link.NextInSector.PreviousInSector = link.PreviousInSector; } link = link.NextLink; } }
private void LinkSectors(ClipSector node) { ClipLink link; while (node.Axis != -1) { float min = ((node.Axis == 0) ? _absBounds.Min.X : ((node.Axis == 1) ? _absBounds.Min.Y : _absBounds.Min.Z)); float max = ((node.Axis == 0) ? _absBounds.Max.X : ((node.Axis == 1) ? _absBounds.Max.Y : _absBounds.Max.Z)); if (min > node.Distance) { node = node.Children[0]; } else if (max < node.Distance) { node = node.Children[1]; } else { LinkSectors(node.Children[0]); node = node.Children[1]; } } link = new ClipLink(); link.Model = this; link.Sector = node; link.NextInSector = node.Links; link.PreviousInSector = null; if (node.Links != null) { node.Links.PreviousInSector = link; } node.Links = link; link.NextLink = _clipLinks; _clipLinks = link; }
private void LinkSectors(ClipSector node) { ClipLink link; while(node.Axis != -1) { float min = ((node.Axis == 0) ? _absBounds.Min.X : ((node.Axis == 1) ? _absBounds.Min.Y : _absBounds.Min.Z)); float max = ((node.Axis == 0) ? _absBounds.Max.X : ((node.Axis == 1) ? _absBounds.Max.Y : _absBounds.Max.Z)); if(min > node.Distance) { node = node.Children[0]; } else if(max < node.Distance) { node = node.Children[1]; } else { LinkSectors(node.Children[0]); node = node.Children[1]; } } link = new ClipLink(); link.Model = this; link.Sector = node; link.NextInSector = node.Links; link.PreviousInSector = null; if(node.Links != null) { node.Links.PreviousInSector = link; } node.Links = link; link.NextLink = _clipLinks; _clipLinks = link; }