当前位置: 首页>>代码示例>>C++>>正文


C++ LLPickInfo::getObject方法代码示例

本文整理汇总了C++中LLPickInfo::getObject方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPickInfo::getObject方法的具体用法?C++ LLPickInfo::getObject怎么用?C++ LLPickInfo::getObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLPickInfo的用法示例。


在下文中一共展示了LLPickInfo::getObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handle_media_click

static bool handle_media_click(const LLPickInfo& pick)
{
	//FIXME: how do we handle object in different parcel than us?
	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
	LLPointer<LLViewerObject> objectp = pick.getObject();


	if (!parcel ||
		objectp.isNull() ||
		pick.mObjectFace < 0 || 
		pick.mObjectFace >= objectp->getNumTEs()) 
	{
		LLSelectMgr::getInstance()->deselect();
		LLViewerMediaFocus::getInstance()->clearFocus();

		return false;
	}



	// HACK: This is directly referencing an impl name.  BAD!
	// This can be removed when we have a truly generic media browser that only 
	// builds an impl based on the type of url it is passed.

	// is media playing on this face?
	const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);

	viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
	if (tep
		&& media_impl.notNull()
		&& media_impl->hasMedia()
		&& gSavedSettings.getBOOL("MediaOnAPrimUI"))
	{
		LLObjectSelectionHandle selection = LLViewerMediaFocus::getInstance()->getSelection(); 
		if (! selection->contains(pick.getObject(), pick.mObjectFace))
		{
			LLViewerMediaFocus::getInstance()->setFocusFace(TRUE, pick.getObject(), pick.mObjectFace, media_impl);
		}
		else
		{
			media_impl->mouseDown(pick.mXYCoords.mX, pick.mXYCoords.mY);
			media_impl->mouseCapture(); // the mouse-up will happen when capture is lost
		}

		return true;
	}

	LLSelectMgr::getInstance()->deselect();
	LLViewerMediaFocus::getInstance()->clearFocus();

	return false;
}
开发者ID:zwagoth,项目名称:Emerald-SVN-History,代码行数:52,代码来源:lltoolpie.cpp

示例2: handleMediaClick

bool LLToolPie::handleMediaClick(const LLPickInfo& pick)
{
	//FIXME: how do we handle object in different parcel than us?
	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
	LLPointer<LLViewerObject> objectp = pick.getObject();


	if (!parcel ||
		objectp.isNull() ||
		pick.mObjectFace < 0 || 
		pick.mObjectFace >= objectp->getNumTEs()) 
	{
		LLViewerMediaFocus::getInstance()->clearFocus();

		return false;
	}

	// Does this face have media?
	const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
	if(!tep)
		return false;

	LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : NULL;
	if(!mep)
		return false;
	
	viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID());

	if (gSavedSettings.getBOOL("MediaOnAPrimUI"))
	{
		if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) || media_impl.isNull())
		{
			// It's okay to give this a null impl
			LLViewerMediaFocus::getInstance()->setFocusFace(pick.getObject(), pick.mObjectFace, media_impl, pick.mNormal);
		}
		else
		{
			// Make sure keyboard focus is set to the media focus object.
			gFocusMgr.setKeyboardFocus(LLViewerMediaFocus::getInstance());
			
			media_impl->mouseDown(pick.mUVCoords, gKeyboard->currentMask(TRUE));
			mMediaMouseCaptureID = mep->getMediaID();
			setMouseCapture(TRUE);  // This object will send a mouse-up to the media when it loses capture.
		}

		return true;
	}

	LLViewerMediaFocus::getInstance()->clearFocus();

	return false;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:52,代码来源:lltoolpie.cpp

示例3: pickCallback

void LLToolGrab::pickCallback(const LLPickInfo& pick_info)
{
	LLToolGrab::getInstance()->mGrabPick = pick_info;
	LLViewerObject	*objectp = pick_info.getObject();

	BOOL extend_select = (pick_info.mKeyMask & MASK_SHIFT);

	if (!extend_select && !LLSelectMgr::getInstance()->getSelection()->isEmpty())
	{
		LLSelectMgr::getInstance()->deselectAll();
		LLToolGrab::getInstance()->mDeselectedThisClick = TRUE;
	}
	else
	{
		LLToolGrab::getInstance()->mDeselectedThisClick = FALSE;
	}

	// if not over object, do nothing
	if (!objectp)
	{
		LLToolGrab::getInstance()->setMouseCapture(TRUE);
		LLToolGrab::getInstance()->mMode = GRAB_NOOBJECT;
		LLToolGrab::getInstance()->mGrabPick.mObjectID.setNull();
	}
	else
	{
		LLToolGrab::getInstance()->handleObjectHit(LLToolGrab::getInstance()->mGrabPick);
	}
}
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:29,代码来源:lltoolgrab.cpp

示例4: pickCallback

void LLHoverView::pickCallback(const LLPickInfo& pick_info)
{
	gHoverView->mLastPickInfo = pick_info;
	LLViewerObject* hit_obj = pick_info.getObject();

	if (hit_obj)
	{
		gHoverView->setHoverActive(TRUE);
		LLSelectMgr::getInstance()->setHoverObject(hit_obj, pick_info.mObjectFace);
		gHoverView->mLastHoverObject = hit_obj;
		gHoverView->mHoverOffset = pick_info.mObjectOffset;
	}
	else
	{
		gHoverView->mLastHoverObject = NULL;
	}

	// We didn't hit an object, but we did hit land.
	if (!hit_obj && pick_info.mPosGlobal != LLVector3d::zero)
	{
		gHoverView->setHoverActive(TRUE);
		gHoverView->mHoverLandGlobal = pick_info.mPosGlobal;
		LLViewerParcelMgr::getInstance()->requestHoverParcelProperties( gHoverView->mHoverLandGlobal );
	}
	else
	{
		gHoverView->mHoverLandGlobal = LLVector3d::zero;
	}

	gHoverView->mDoneHoverPick = TRUE;
}
开发者ID:N3X15,项目名称:Luna-Viewer,代码行数:31,代码来源:llhoverview.cpp

示例5: pickCallback

void LLToolGrab::pickCallback(const LLPickInfo& pick_info)
{
	LLToolGrab::getInstance()->mGrabPick = pick_info;
	LLViewerObject	*objectp = pick_info.getObject();

	BOOL extend_select = (pick_info.mKeyMask & MASK_SHIFT);

	if (!extend_select && !LLSelectMgr::getInstance()->getSelection()->isEmpty())
	{
		LLSelectMgr::getInstance()->deselectAll();
		LLToolGrab::getInstance()->mDeselectedThisClick = TRUE;
	}
	else
	{
		LLToolGrab::getInstance()->mDeselectedThisClick = FALSE;
	}

	// if not over object, do nothing
//	if (!objectp)
// [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Added: RLVa-1.1.0l
	// Block initiating a drag operation on an object that can't be touched
	if ( (!objectp) || ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(objectp, pick_info.mObjectOffset))) )
// [/RLVa:KB]
	{
		LLToolGrab::getInstance()->setMouseCapture(TRUE);
		LLToolGrab::getInstance()->mMode = GRAB_NOOBJECT;
		LLToolGrab::getInstance()->mGrabPick.mObjectID.setNull();
	}
	else
	{
		LLToolGrab::getInstance()->handleObjectHit(LLToolGrab::getInstance()->mGrabPick);
	}
}
开发者ID:DarkSpyro003,项目名称:DarkSpyros_Viewer,代码行数:33,代码来源:lltoolgrab.cpp

示例6: pickCallback

void LLToolCompInspect::pickCallback(const LLPickInfo& pick_info)
{
	LLViewerObject* hit_obj = pick_info.getObject();

	if (!LLToolCompInspect::getInstance()->mMouseDown)
	{
		// fast click on object, but mouse is already up...just do select
		LLToolCompInspect::getInstance()->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE);
		return;
	}

	if( hit_obj )
	{
		if (LLSelectMgr::getInstance()->getSelection()->getObjectCount())
		{
			LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance();
		}
		LLToolCompInspect::getInstance()->setCurrentTool( LLToolCompInspect::getInstance()->mSelectRect );
		LLToolCompInspect::getInstance()->mSelectRect->handlePick( pick_info );

	}
	else
	{
		LLToolCompInspect::getInstance()->setCurrentTool( LLToolCompInspect::getInstance()->mSelectRect );
		LLToolCompInspect::getInstance()->mSelectRect->handlePick( pick_info );
	}
}
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:27,代码来源:lltoolcomp.cpp

示例7: handleMediaHover

bool LLToolPie::handleMediaHover(const LLPickInfo& pick)
{
	//FIXME: how do we handle object in different parcel than us?
	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
	if (!parcel) return false;

	LLPointer<LLViewerObject> objectp = pick.getObject();

	// Early out cases.  Must clear media hover. 
	// did not hit an object or did not hit a valid face
	if ( objectp.isNull() ||
		pick.mObjectFace < 0 || 
		pick.mObjectFace >= objectp->getNumTEs() )
	{
		LLViewerMediaFocus::getInstance()->clearHover();
		return false;
	}

	// Does this face have media?
	const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
	if(!tep)
		return false;
	
	const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL;
	if (mep
		&& gSavedSettings.getBOOL("MediaOnAPrimUI"))
	{		
		viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID());
		
		if(media_impl.notNull())
		{
			// Update media hover object
			if (!LLViewerMediaFocus::getInstance()->isHoveringOverFace(objectp, pick.mObjectFace))
			{
				LLViewerMediaFocus::getInstance()->setHoverFace(objectp, pick.mObjectFace, media_impl, pick.mNormal);
			}
			
			// If this is the focused media face, send mouse move events.
			if (LLViewerMediaFocus::getInstance()->isFocusedOnFace(objectp, pick.mObjectFace))
			{
				media_impl->mouseMove(pick.mUVCoords, gKeyboard->currentMask(TRUE));
				gViewerWindow->setCursor(media_impl->getLastSetCursor());
			}
			else
			{
				// This is not the focused face -- set the default cursor.
				gViewerWindow->setCursor(UI_CURSOR_ARROW);
			}

			return true;
		}
	}
	
	// In all other cases, clear media hover.
	LLViewerMediaFocus::getInstance()->clearHover();

	return false;
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:58,代码来源:lltoolpie.cpp

示例8: pickCallback

void LLToolFace::pickCallback(const LLPickInfo& pick_info)
{
    LLViewerObject* hit_obj	= pick_info.getObject();
    if (hit_obj)
    {
//MK
        if (gRRenabled && !gAgent.mRRInterface.canTouch (hit_obj))
        {
            return;
        }
//mk
        S32 hit_face = pick_info.mObjectFace;

        if (hit_obj->isAvatar())
        {
            // ...clicked on an avatar, so don't do anything
            return;
        }

        // ...clicked on a world object, try to pick the appropriate face

        if (pick_info.mKeyMask & MASK_SHIFT)
        {
            // If object not selected, need to inform sim
            if ( !hit_obj->isSelected() )
            {
                // object wasn't selected so add the object and face
                LLSelectMgr::getInstance()->selectObjectOnly(hit_obj, hit_face);
            }
            else if (!LLSelectMgr::getInstance()->getSelection()->contains(hit_obj, hit_face) )
            {
                // object is selected, but not this face, so add it.
                LLSelectMgr::getInstance()->addAsIndividual(hit_obj, hit_face);
            }
            else
            {
                // object is selected, as is this face, so remove the face.
                LLSelectMgr::getInstance()->remove(hit_obj, hit_face);

                // BUG: If you remove the last face, the simulator won't know about it.
            }
        }
        else
        {
            // clicked without modifiers, select only
            // this face
            LLSelectMgr::getInstance()->deselectAll();
            LLSelectMgr::getInstance()->selectObjectOnly(hit_obj, hit_face);
        }
    }
    else
    {
        if (!(pick_info.mKeyMask == MASK_SHIFT))
        {
            LLSelectMgr::getInstance()->deselectAll();
        }
    }
}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:58,代码来源:lltoolface.cpp

示例9: pickCallback

void LLToolIndividual::pickCallback(const LLPickInfo& pick_info)
{
	LLViewerObject* obj = pick_info.getObject();
	LLSelectMgr::getInstance()->deselectAll();
	if(obj)
	{
		LLSelectMgr::getInstance()->selectObjectOnly(obj);
	}
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:9,代码来源:lltoolindividual.cpp

示例10: handle_media_hover

static bool handle_media_hover(const LLPickInfo& pick)
{
	//FIXME: how do we handle object in different parcel than us?
	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
	if (!parcel) return false;

	LLPointer<LLViewerObject> objectp = pick.getObject();

	// Early out cases.  Must clear mouse over media focus flag
	// did not hit an object or did not hit a valid face
	if ( objectp.isNull() ||
		pick.mObjectFace < 0 || 
		pick.mObjectFace >= objectp->getNumTEs() )
	{
		LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);
		return false;
	}


	// HACK: This is directly referencing an impl name.  BAD!
	// This can be removed when we have a truly generic media browser that only 
	// builds an impl based on the type of url it is passed.

	// is media playing on this face?
	const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
	viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(tep->getID());
	if (tep
		&& media_impl.notNull()
		&& media_impl->hasMedia()
		&& gSavedSettings.getBOOL("MediaOnAPrimUI"))
	{
		if(LLViewerMediaFocus::getInstance()->getFocus())
		{
			media_impl->mouseMove(pick.mXYCoords.mX, pick.mXYCoords.mY);
		}

		// Set mouse over flag if unset
		if (! LLViewerMediaFocus::getInstance()->getMouseOverFlag())
		{
			LLSelectMgr::getInstance()->setHoverObject(objectp, pick.mObjectFace);
			LLViewerMediaFocus::getInstance()->setMouseOverFlag(true, media_impl);
			LLViewerMediaFocus::getInstance()->setPickInfo(pick);
		}

		return true;
	}
	LLViewerMediaFocus::getInstance()->setMouseOverFlag(false);

	return false;
}
开发者ID:zwagoth,项目名称:Emerald-SVN-History,代码行数:50,代码来源:lltoolpie.cpp

示例11: playCurrentMedia

// static
void LLToolPie::playCurrentMedia(const LLPickInfo& info)
{
	//FIXME: how do we handle object in different parcel than us?
	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
	if (!parcel) return;
	
	LLPointer<LLViewerObject> objectp = info.getObject();
	
	// Early out cases.  Must clear media hover. 
	// did not hit an object or did not hit a valid face
	if ( objectp.isNull() ||
		info.mObjectFace < 0 || 
		info.mObjectFace >= objectp->getNumTEs() )
	{
		return;
	}
	
	// Does this face have media?
	const LLTextureEntry* tep = objectp->getTE(info.mObjectFace);
	if (!tep)
		return;
	
	const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL;
	if(!mep)
		return;
	
	//TODO: Can you Use it? 

	LLPluginClassMedia* media_plugin = NULL;
	
	viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID());
		
	if(media_impl.notNull() && media_impl->hasMedia())
	{
		media_plugin = media_impl->getMediaPlugin();
		if (media_plugin && media_plugin->pluginSupportsMediaTime())
		{
			if(media_impl->isMediaPlaying())
			{
				media_impl->pause();
			}
			else 
			{
				media_impl->play();
			}
		}
	}


}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:51,代码来源:lltoolpie.cpp

示例12: pickCallback

void LLToolPipette::pickCallback(const LLPickInfo& pick_info)
{
	LLViewerObject* hit_obj	= pick_info.getObject();
	LLSelectMgr::getInstance()->unhighlightAll();

	// if we clicked on a face of a valid prim, save off texture entry data
	if (hit_obj && 
		hit_obj->getPCode() == LL_PCODE_VOLUME &&
		pick_info.mObjectFace != -1)
	{
		//TODO: this should highlight the selected face only
		LLSelectMgr::getInstance()->highlightObjectOnly(hit_obj);
		const LLTextureEntry* entry = hit_obj->getTE(pick_info.mObjectFace);
		LLToolPipette::getInstance()->setTextureEntry(entry);
	}
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:16,代码来源:lltoolpipette.cpp

示例13: pickCallback

void QToolAlign::pickCallback(const LLPickInfo& pick_info)
{
	LLViewerObject* object = pick_info.getObject();

	if (object)
	{
		if (object->isAvatar())
		{
			return;
		}

		if (pick_info.mKeyMask & MASK_SHIFT)
		{
			// If object not selected, select it
			if ( !object->isSelected() )
			{
				LLSelectMgr::getInstance()->selectObjectAndFamily(object);
			}
			else
			{
				LLSelectMgr::getInstance()->deselectObjectAndFamily(object);
			}
		}
		else
		{
			LLSelectMgr::getInstance()->deselectAll();
			LLSelectMgr::getInstance()->selectObjectAndFamily(object);
		}
		
	}
	else
	{
		if (!(pick_info.mKeyMask == MASK_SHIFT))
		{
			LLSelectMgr::getInstance()->deselectAll();
		}
	}

	LLSelectMgr::getInstance()->promoteSelectionToRoot();
}
开发者ID:OS-Development,项目名称:VW.Dolphin_v3,代码行数:40,代码来源:qtoolalign.cpp

示例14: handleObjectSelection

// static
LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pick, BOOL ignore_group, BOOL temp_select, BOOL select_root)
{
	LLViewerObject* object = pick.getObject();
	if (select_root)
	{
		object = object->getRootEdit();
	}

// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f
	if (rlv_handler_t::isEnabled())
	{
		if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT))
		{
			if (!temp_select)
			{
				return LLSelectMgr::getInstance()->getSelection();
			}
			else
			{
				// Temporary selection, but if the build floater is open then it'll be permanent so get rid of the floater
				if (gFloaterTools->getVisible())
				{
					// Copy/paste from toggle_build_mode()
					gAgent.resetView(false);
					gFloaterTools->close();
					gViewerWindow->showCursor();
				}
			}
		}
		
		if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (object) && ((!object->isAttachment()) || (!object->permYouOwner())) &&
			 (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > 1.5f * 1.5f) )
		{
			// NOTE-RLVa: see behaviour notes for a rather lengthy explanation of why we're doing things this way
			//if (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion() + pick.mObjectOffset) > 1.5f * 1.5f)
			if (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f)
			{
				if ( (gFloaterTools->getVisible()) && (pick.mKeyMask != MASK_SHIFT) && (pick.mKeyMask != MASK_CONTROL) )
					LLSelectMgr::getInstance()->deselectAll();
				return LLSelectMgr::getInstance()->getSelection();
			}
			else if (gFloaterTools->getVisible())
			{
				// Copy/paste from toggle_build_mode()
				gAgent.resetView(false);
				gFloaterTools->close();
				gViewerWindow->showCursor();
			}
		}
	}
// [/RLVa:KB]

	BOOL select_owned = gSavedSettings.getBOOL("SelectOwnedOnly");
	BOOL select_movable = gSavedSettings.getBOOL("SelectMovableOnly");
	BOOL select_region = gSavedSettings.getBOOL("SelectThisRegionOnly");
	
	// *NOTE: These settings must be cleaned up at bottom of function.
	if (temp_select || gAllowSelectAvatar)
	{
		gSavedSettings.setBOOL("SelectOwnedOnly", FALSE);
		gSavedSettings.setBOOL("SelectMovableOnly", FALSE);
		gSavedSettings.setBOOL("SelectThisRegionOnly", TRUE);
		LLSelectMgr::getInstance()->setForceSelection(TRUE);
	}

	BOOL extend_select = (pick.mKeyMask == MASK_SHIFT) || (pick.mKeyMask == MASK_CONTROL);

	// If no object, check for icon, then just deselect
	if (!object)
	{
		LLHUDIcon* last_hit_hud_icon = pick.mHUDIcon;

		if (last_hit_hud_icon && last_hit_hud_icon->getSourceObject())
		{
			LLFloaterScriptDebug::show(last_hit_hud_icon->getSourceObject()->getID());
		}
		else if (!extend_select)
		{
			LLSelectMgr::getInstance()->deselectAll();
		}
	}
	else
	{
		BOOL already_selected = object->isSelected();

		if ( extend_select )
		{
			if ( already_selected )
			{
				if ( ignore_group )
				{
					LLSelectMgr::getInstance()->deselectObjectOnly(object);
				}
				else
				{
					LLSelectMgr::getInstance()->deselectObjectAndFamily(object, TRUE, TRUE);
				}
			}
			else
//.........这里部分代码省略.........
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:101,代码来源:lltoolselect.cpp

示例15: pickCallback

void LLToolFace::pickCallback(const LLPickInfo& pick_info)
{
	LLViewerObject* hit_obj	= pick_info.getObject();
	if (hit_obj)
	{
		S32 hit_face = pick_info.mObjectFace;
		
		if (hit_obj->isAvatar())
		{
			// ...clicked on an avatar, so don't do anything
			return;
		}

// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f
		if ( (rlv_handler_t::isEnabled()) &&
			 ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || 
			   ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!hit_obj->isAttachment()) || (!hit_obj->permYouOwner())) && 
			     (dist_vec_squared(gAgent.getPositionAgent(), hit_obj->getPositionRegion() + pick_info.mObjectOffset) > 1.5f * 1.5f) )))
		{
			return;
		}
// [/RLVa:KB]

		// ...clicked on a world object, try to pick the appropriate face

		if (pick_info.mKeyMask & MASK_SHIFT)
		{
			// If object not selected, need to inform sim
			if ( !hit_obj->isSelected() )
			{
				// object wasn't selected so add the object and face
				LLSelectMgr::getInstance()->selectObjectOnly(hit_obj, hit_face);
			}
			else if (!LLSelectMgr::getInstance()->getSelection()->contains(hit_obj, hit_face) )
			{
				// object is selected, but not this face, so add it.
				LLSelectMgr::getInstance()->addAsIndividual(hit_obj, hit_face);
			}
			else
			{
				// object is selected, as is this face, so remove the face.
				LLSelectMgr::getInstance()->remove(hit_obj, hit_face);

				// BUG: If you remove the last face, the simulator won't know about it.
			}
		}
		else
		{
			// clicked without modifiers, select only
			// this face
			LLSelectMgr::getInstance()->deselectAll();
			LLSelectMgr::getInstance()->selectObjectOnly(hit_obj, hit_face);
		}
	}
	else
	{
		if (!(pick_info.mKeyMask == MASK_SHIFT))
		{
			LLSelectMgr::getInstance()->deselectAll();
		}
	}
}
开发者ID:lilly,项目名称:imprudence,代码行数:62,代码来源:lltoolface.cpp


注:本文中的LLPickInfo::getObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。