示例#1
0
// ***************************************************************************
void			UTransform::parent(UTransform newFather)
{
	CTransform	*object = getObjectPtr();
	if (object->getForceClipRoot())
	{
		nlwarning("Transform has been flagged to be glued to the root, can't change parent. See UTransform::setForceClipRoot(bool).");
		return;
	}
	if(!newFather.empty())
	{
		// link me to other.
		CTransform	*other= newFather.getObjectPtr();
		if(other->getOwnerScene()!=object->getOwnerScene())
			nlerror("Try to parent 2 object from 2 differnet scenes!!");
		other->hrcLinkSon( object );
	}
	else
	{
		// link me to Root.
		object->getOwnerScene()->getRoot()->hrcLinkSon( object );
	}
}
示例#2
0
bool UTransform::getForceClipRoot() const
{
	CTransform	*object = getObjectPtr();
	return object->getForceClipRoot();
}