本文整理汇总了C++中LLPickInfo类的典型用法代码示例。如果您正苦于以下问题:C++ LLPickInfo类的具体用法?C++ LLPickInfo怎么用?C++ LLPickInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLPickInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stopGrab
void LLToolGrab::stopGrab()
{
LLViewerObject* objectp = mGrabPick.getObject();
if (!objectp)
{
return;
}
LLPickInfo pick = mGrabPick;
if (mMode == GRAB_NONPHYSICAL)
{
// for non-physical (touch) grabs,
// gather surface info for this degrab (mouse-up)
S32 x = gViewerWindow->getCurrentMouseX();
S32 y = gViewerWindow->getCurrentMouseY();
pick.mMousePt = LLCoordGL(x, y);
pick.getSurfaceInfo();
}
// Next, send messages to simulator
LLMessageSystem *msg = gMessageSystem;
switch(mMode)
{
case GRAB_ACTIVE_CENTER:
case GRAB_NONPHYSICAL:
case GRAB_LOCKED:
msg->newMessageFast(_PREHASH_ObjectDeGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage(objectp->getRegion()->getHost());
mVerticalDragging = FALSE;
break;
case GRAB_NOOBJECT:
case GRAB_INACTIVE:
default:
// do nothing
break;
}
mHideBuildHighlight = FALSE;
}
示例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;
}
示例3: 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;
}
示例4: 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);
}
}
示例5: 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;
}
示例6: 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);
}
}
示例7: 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 );
}
}
示例8: 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;
}
示例9: 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();
}
}
}
示例10: pickCallback
void LLToolIndividual::pickCallback(const LLPickInfo& pick_info)
{
LLViewerObject* obj = pick_info.getObject();
LLSelectMgr::getInstance()->deselectAll();
if(obj)
{
LLSelectMgr::getInstance()->selectObjectOnly(obj);
}
}
示例11: stopGrab
void LLToolGrab::stopGrab()
{
LLViewerObject* objectp = mGrabPick.getObject();
if (!objectp)
{
return;
}
LLPickInfo pick = mGrabPick;
if (mMode == GRAB_NONPHYSICAL)
{
// for non-physical (touch) grabs,
// gather surface info for this degrab (mouse-up)
S32 x = gViewerWindow->getCurrentMouseX();
S32 y = gViewerWindow->getCurrentMouseY();
pick.mMousePt = LLCoordGL(x, y);
pick.getSurfaceInfo();
}
// Next, send messages to simulator
switch(mMode)
{
case GRAB_ACTIVE_CENTER:
case GRAB_NONPHYSICAL:
case GRAB_LOCKED:
send_ObjectDeGrab_message(objectp, pick);
mVerticalDragging = FALSE;
break;
case GRAB_NOOBJECT:
case GRAB_INACTIVE:
default:
// do nothing
break;
}
mHideBuildHighlight = FALSE;
}
示例12: 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;
}
示例13: 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();
}
}
}
}
示例14: 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);
}
}
示例15: 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();
}