Axiom.Core.BillboardChain.RemoveChainElement C# (CSharp) Method

RemoveChainElement() public method

public RemoveChainElement ( int chainIndex ) : void
chainIndex int
return void
		public virtual void RemoveChainElement( int chainIndex )
		{
			if ( chainIndex >= this.chainCount )
			{
				throw new IndexOutOfRangeException();
			}
			ChainSegment segment = this.chainSegmentList[ chainIndex ];
			if ( segment.head == SEGMENT_EMPTY )
				return; // nothing to remove

			if ( segment.tail == segment.head )
			{
				// last item
				segment.head = segment.tail = SEGMENT_EMPTY;
			}
			else if ( segment.tail == 0 )
			{
				segment.tail = this.maxElementsPerChain - 1;
			}
			else
			{
				--this.maxElementsPerChain;
			}

			// we removed an entry so indexes need updating
			this.indexContentDirty = true;
			this.boundsDirty = true;
			// tell parent node to update bounds
			if ( ParentNode != null )
			{
				ParentNode.NeedUpdate();
			}
		}