コード例 #1
0
//-----------------------------------------------------------------------------
// addObject()
//-----------------------------------------------------------------------------
BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
{
//	object->extractAttachmentItemID();

	// Same object reattached
	if (isObjectAttached(object))
	{
		LL_INFOS() << "(same object re-attached)" << LL_ENDL;
		LL_INFOS("Attachment") << object->getID() << " ("<<object->getAttachmentPointName()<<") OBJECT re-attached" << LL_ENDL;
		removeObject(object);
		// Pass through anyway to let setupDrawable()
		// re-connect object to the joint correctly
	}
	
// [SL:KB] - Patch: Appearance-Misc | Checked: Catznip-3.0.0a (2011-01-13) | Added: Catznip-2.4.0h
	// LLViewerJointAttachment::removeObject() sets the object's item to the NULL UUID so we need to extract it *after* the block above
	object->extractAttachmentItemID();
// [/SL:KB]
	// Two instances of the same inventory item attached --
	// Request detach, and kill the object in the meantime.
	if (getAttachedObject(object->getAttachmentItemID()))
	{
		LL_INFOS() << "(same object re-attached)" << LL_ENDL;
		LL_INFOS("Attachment") << object->getID() << " ("<<object->getAttachmentPointName()<<") ITEM re-attached" << LL_ENDL;
		object->markDead();

		// If this happens to be attached to self, then detach.
		LLVOAvatarSelf::detachAttachmentIntoInventory(object->getAttachmentItemID());
		return FALSE;
	}

	mAttachedObjects.push_back(object);
	setupDrawable(object);
	
	if (mIsHUDAttachment)
	{
		if (object->mText.notNull())
		{
			object->mText->setOnHUDAttachment(TRUE);
		}
		LLViewerObject::const_child_list_t& child_list = object->getChildren();
		for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
			 iter != child_list.end(); ++iter)
		{
			LLViewerObject* childp = *iter;
			if (childp && childp->mText.notNull())
			{
				childp->mText->setOnHUDAttachment(TRUE);
			}
		}
	}
	calcLOD();
	mUpdateXform = TRUE;
	
	return TRUE;
}
コード例 #2
0
//-----------------------------------------------------------------------------
// addObject()
//-----------------------------------------------------------------------------
BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
{
	object->extractAttachmentItemID();

	if (isObjectAttached(object))
	{
		llinfos << "(same object re-attached)" << llendl;
		removeObject(object);
		// Pass through anyway to let setupDrawable()
		// re-connect object to the joint correctly
	}
	
	// Two instances of the same inventory item attached --
	// Request detach, and kill the object in the meantime.
	if (getAttachedObject(object->getAttachmentItemID()))
	{
		llinfos << "(same object re-attached)" << llendl;
		object->markDead();

		// If this happens to be attached to self, then detach.
		LLVOAvatar::detachAttachmentIntoInventory(object->getAttachmentItemID());
		return FALSE;
	}

	mAttachedObjects.push_back(object);
	setupDrawable(object);
	
	if (mIsHUDAttachment)
	{
		if (object->mText.notNull())
		{
			object->mText->setOnHUDAttachment(TRUE);
		}
		LLViewerObject::const_child_list_t& child_list = object->getChildren();
		for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
			 iter != child_list.end(); ++iter)
		{
			LLViewerObject* childp = *iter;
			if (childp && childp->mText.notNull())
			{
				childp->mText->setOnHUDAttachment(TRUE);
			}
		}
	}
	calcLOD();
	mUpdateXform = TRUE;

	return TRUE;
}
コード例 #3
0
//-----------------------------------------------------------------------------
// addObject()
//-----------------------------------------------------------------------------
BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
{
//	object->extractAttachmentItemID();

	if (isObjectAttached(object))
	{
		llinfos << "(same object re-attached)" << llendl;
		removeObject(object);
		// Pass through anyway to let setupDrawable()
		// re-connect object to the joint correctly
	}

	object->extractAttachmentItemID();

	mAttachedObjects.push_back(object);
	setupDrawable(object);

	if (mIsHUDAttachment)
	{
		if (object->mText.notNull())
		{
			object->mText->setOnHUDAttachment(TRUE);
		}
		LLViewerObject::const_child_list_t& child_list = object->getChildren();
		for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
			 iter != child_list.end(); ++iter)
		{
			LLViewerObject* childp = *iter;
			if (childp && childp->mText.notNull())
			{
				childp->mText->setOnHUDAttachment(TRUE);
			}
		}
	}
	calcLOD();
	mUpdateXform = TRUE;

	return TRUE;
}