src/taesooLib/PhysicsLib/TRL/Link.cpp
bool Link::detachChild(Link* childToRemove)
{
	bool removed = false;

	Link* link = child;
	Link* prevSibling = 0;
	while(link){
		if(link == childToRemove){
			removed = true;
			if(prevSibling){
				prevSibling->sibling = link->sibling;
			} else {
				child = link->sibling;
			}
			break;
		}
		prevSibling = link;
		link = link->sibling;
	}

	if(removed){
		childToRemove->parent = 0;
		childToRemove->sibling = 0;
		setBodyIter(childToRemove, 0);
	}

	return removed;
}
/**
   A child link is detached from the link.
   The detached child link is *not* deleted by this function.
   If a link given by the parameter is not a child of the link, false is returned.
*/
A child link is detached from the link.
The detached child link is *not* deleted by this function.
If a link given by the parameter is not a child of the link, false is returned.
A child link is detached from the link . The detached child link is * not * deleted by this function . If a link given by the parameter is not a child of the link false is returned .
bool Link::detachChild(Link* childToRemove)
{
	bool removed = false;
	Link* link = child;
	Link* prevSibling = 0;
	while(link){
		if(link == childToRemove){
			removed = true;
			if(prevSibling){
				prevSibling->sibling = link->sibling;
			} else {
				child = link->sibling;
			}
			break;
		}
		prevSibling = link;
		link = link->sibling;
	}
	if(removed){
		childToRemove->parent = 0;
		childToRemove->sibling = 0;
		setBodyIter(childToRemove, 0);
	}
	return removed;
}
bool Link :: detachChild ( Link * childToRemove ) { bool removed = false ; Link * link = child ; Link * prevSibling = 0 ; while ( link ) { if ( link == childToRemove ) { removed = true ; if ( prevSibling ) { prevSibling -> sibling = link -> sibling ; } else { child = link -> sibling ; } break ; } prevSibling = link ; link = link -> sibling ; } if ( removed ) { childToRemove -> parent = 0 ; childToRemove -> sibling = 0 ; setBodyIter ( childToRemove , 0 ) ; } return removed ; }
A child link is detached from the link.
A child link is detached from the link .