本文整理汇总了C++中LLVOAvatar类的典型用法代码示例。如果您正苦于以下问题:C++ LLVOAvatar类的具体用法?C++ LLVOAvatar怎么用?C++ LLVOAvatar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLVOAvatar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setParamsToDefaults
void LLWearable::setParamsToDefaults()
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
mVisualParamMap.clear();
for( LLVisualParam* param = avatar->getFirstVisualParam(); param; param = avatar->getNextVisualParam() )
{
if( (((LLViewerVisualParam*)param)->getWearableType() == mType ) && (param->isTweakable()) )
{
mVisualParamMap[param->getID()] = param->getDefaultWeight();
}
}
}
示例2: validateEaseOut
//-----------------------------------------------------------------------------
// validateEaseOut()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::validateEaseOut(LLUICtrl* spin, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return FALSE;
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID);
if (!motionp->getLoop())
{
F32 new_ease_out = llclamp((F32)previewp->childGetValue("ease_out_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration());
previewp->childSetValue("ease_out_time", LLSD(new_ease_out));
}
return TRUE;
}
示例3: llassert
// Does not copy mAssetID.
// Definition version is current: removes obsolete enties and creates default values for new ones.
void LLWearable::copyDataFrom( LLWearable* src )
{
LLVOAvatar* avatar = gAgent.getAvatarObject();
llassert( avatar );
if( !avatar )
{
return;
}
mDefinitionVersion = LLWearable::sCurrentDefinitionVersion;
mName = src->mName;
mDescription = src->mDescription;
mPermissions = src->mPermissions;
mSaleInfo = src->mSaleInfo;
mType = src->mType;
// Deep copy of mVisualParamMap (copies only those params that are current, filling in defaults where needed)
for( LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam() )
{
if( (param->getWearableType() == mType) && (param->isTweakable() ) )
{
S32 id = param->getID();
F32 weight = get_if_there(src->mVisualParamMap, id, param->getDefaultWeight() );
if(id == 507)
avatar->setActualBoobGrav(weight);
mVisualParamMap[id] = weight;
}
}
// Deep copy of mTEMap (copies only those tes that are current, filling in defaults where needed)
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if( LLVOAvatar::getTEWearableType((ETextureIndex) te ) == mType )
{
const LLUUID& image_id = get_if_there(src->mTEMap, te, LLVOAvatar::getDefaultTEImageID((ETextureIndex) te ) );
mTEMap[te] = image_id;
}
}
}
示例4: onBtnPlay
//-----------------------------------------------------------------------------
// onBtnPlay()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnPlay(void* user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
return;
if (previewp->mMotionID.notNull())
{
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
if(!avatarp->isMotionActive(previewp->mMotionID))
{
previewp->resetMotion();
previewp->mPauseRequest = NULL;
}
else
{
if (avatarp->areAnimationsPaused())
{
previewp->mPauseRequest = NULL;
}
else
{
previewp->mPauseRequest = avatarp->requestPause();
}
}
}
}
示例5: preRender
void LLVisualParamHint::preRender(BOOL clear_depth)
{
LLVOAvatar* avatarp = gAgent.getAvatarObject();
mLastParamWeight = avatarp->getVisualParamWeight(mVisualParam);
avatarp->setVisualParamWeight(mVisualParam, mVisualParamWeight);
avatarp->setVisualParamWeight("Blink_Left", 0.f);
avatarp->setVisualParamWeight("Blink_Right", 0.f);
avatarp->updateComposites();
avatarp->updateVisualParams();
avatarp->updateGeometry(avatarp->mDrawable);
avatarp->updateLOD();
LLDynamicTexture::preRender(clear_depth);
}
示例6: pullCrossWearableValues
void LLWearable::pullCrossWearableValues()
{
// scan through all of the avatar's visual parameters
LLVOAvatar* avatar = gAgent.getAvatarObject();
for (LLViewerVisualParam* param = (LLViewerVisualParam*) avatar->getFirstVisualParam();
param;
param = (LLViewerVisualParam*) avatar->getNextVisualParam())
{
if( param )
{
LLDriverParam *driver_param = dynamic_cast<LLDriverParam*>(param);
if(driver_param)
{
// parameter is a driver parameter, have it update its
driver_param->updateCrossDrivenParams(getType());
}
}
}
}
示例7: childSetEnabled
void LLPanelContents::getState(LLViewerObject *objectp )
{
if( !objectp )
{
childSetEnabled("button new script",FALSE);
return;
}
LLUUID group_id; // used for SL-23488
LLSelectMgr::getInstance()->selectGetGroup(group_id); // sets group_id as a side effect SL-23488
// BUG? Check for all objects being editable?
BOOL editable = gAgent.isGodlike()
|| (objectp->permModify()
&& ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488
BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME );
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.5a
if ( (rlv_handler_t::isEnabled()) && (editable) )
{
// Don't allow creation of new scripts if it's non-detachable
if (objectp->isAttachment())
editable = !gRlvAttachmentLocks.isLockedAttachment(objectp->getRootEdit());
// Don't allow creation of new scripts if we're @unsit=n or @sittp=n restricted and we're sitting on the selection
if ( (editable) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP))) )
{
// Only check the first (non-)root object because nothing else would result in enabling the button (see below)
LLViewerObject* pObj = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(TRUE);
LLVOAvatar* pAvatar = gAgent.getAvatarObject();
editable = (pObj) && (pAvatar) && ((!pAvatar->mIsSitting) || (pAvatar->getRoot() != pObj->getRootEdit()));
}
}
// [/RLVa:KB]
// Edit script button - ok if object is editable and there's an unambiguous destination for the object.
childSetEnabled("button new script",
editable &&
all_volume &&
((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1)
|| (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1)));
}
示例8: getItem
// virtual
void LLPreviewAnim::onClose(bool app_quitting)
{
const LLInventoryItem *item = getItem();
if(item)
{
gAgent.getAvatarObject()->stopMotion(item->getAssetUUID());
gAgent.sendAnimationRequest(item->getAssetUUID(), ANIM_REQUEST_STOP);
LLVOAvatar* avatar = gAgent.getAvatarObject();
LLMotion* motion = avatar->findMotion(item->getAssetUUID());
if (motion)
{
// *TODO: minor memory leak here, user data is never deleted (Use real callbacks)
motion->setDeactivateCallback(NULL, (void *)NULL);
}
}
}
示例9: find_avatar
void LLFloaterAvatarTextures::refresh()
{
LLVOAvatar *avatarp = find_avatar(mID);
if (avatarp)
{
std::string fullname;
if (gCacheName->getFullName(avatarp->getID(), fullname))
{
setTitle(mTitle + ": " + fullname);
}
for (U32 i=0; i < TEX_NUM_INDICES; i++)
{
update_texture_ctrl(avatarp, mTextures[i], ETextureIndex(i));
}
}
else
{
setTitle(mTitle + ": INVALID AVATAR (" + mID.asString() + ")");
}
}
示例10:
//-----------------------------------------------------------------------------
// initialize()
//-----------------------------------------------------------------------------
void LLMorphView::initialize()
{
mCameraPitch = 0.f;
mCameraYaw = 0.f;
mCameraDist = -1.f;
LLVOAvatar *avatarp = gAgent.getAvatarObject();
if (!avatarp || avatarp->isDead())
{
gAgent.changeCameraToDefault();
return;
}
avatarp->stopMotion( ANIM_AGENT_BODY_NOISE );
avatarp->mSpecialRenderMode = 3;
// set up camera for close look at avatar
mOldCameraNearClip = LLViewerCamera::getInstance()->getNear();
LLViewerCamera::getInstance()->setNear(MORPH_NEAR_CLIP);
}
示例11: lookAtAvatar
void LLFloaterTopObjects::lookAtAvatar()
{
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
if (!list) return;
LLScrollListItem* first_selected = list->getFirstSelected();
if (!first_selected) return;
LLUUID taskid = first_selected->getUUID();
LLVOAvatar* voavatar = gObjectList.findAvatar(taskid);
if(voavatar)
{
gAgentCamera.setFocusOnAvatar(FALSE, FALSE);
gAgentCamera.changeCameraToThirdPerson();
gAgentCamera.setFocusGlobal(voavatar->getPositionGlobal(),taskid);
gAgentCamera.setCameraPosAndFocusGlobal(voavatar->getPositionGlobal()
+ LLVector3d(3.5,1.35,0.75) * voavatar->getRotation(),
voavatar->getPositionGlobal(),
taskid );
}
}
示例12: onSliderMove
//-----------------------------------------------------------------------------
// onSliderMove()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onSliderMove(LLUICtrl* ctrl, void*user_data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data;
if (!previewp->getEnabled())
return;
LLVOAvatar* avatarp;
if (previewp->mInWorld)
{
if (!gAgent.getAvatarObject())
{
return;
}
avatarp = gAgent.getAvatarObject();
}
else
{
if (!previewp->mAnimPreview)
{
return;
}
avatarp = previewp->mAnimPreview->getDummyAvatar();
}
F32 slider_value = (F32)previewp->childGetValue("playback_slider").asReal();
LLUUID base_id = previewp->mIDList[previewp->childGetValue("preview_base_anim").asString()];
LLMotion* motionp = avatarp->findMotion(previewp->mMotionID);
F32 duration = motionp->getDuration();// + motionp->getEaseOutDuration();
F32 delta_time = duration * slider_value;
avatarp->deactivateAllMotions();
avatarp->startMotion(base_id, delta_time + BASE_ANIM_TIME_OFFSET);
avatarp->startMotion(previewp->mMotionID, delta_time);
previewp->mPauseRequest = avatarp->requestPause();
previewp->refresh();
}
示例13: onCommitBaseAnim
//-----------------------------------------------------------------------------
// onCommitBaseAnim()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data)
{
LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data;
if (!previewp->getEnabled())
return;
if (previewp->mAnimPreview)
{
LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar();
BOOL paused = avatarp->areAnimationsPaused();
// stop all other possible base motions
avatarp->stopMotion(ANIM_AGENT_STAND, TRUE);
avatarp->stopMotion(ANIM_AGENT_WALK, TRUE);
avatarp->stopMotion(ANIM_AGENT_SIT, TRUE);
avatarp->stopMotion(ANIM_AGENT_HOVER, TRUE);
previewp->resetMotion();
if (!paused)
{
previewp->mPauseRequest = NULL;
}
}
}
示例14: isKickable
bool PanelRadar::isKickable(const LLUUID& agent_id)
{
if (agent_id.notNull())
{
LLViewerObject* av_obj = gObjectList.findObject(agent_id);
if (av_obj != NULL && av_obj->isAvatar())
{
LLVOAvatar* avatar = (LLVOAvatar*)av_obj;
LLViewerRegion* region = avatar->getRegion();
if (region)
{
const LLVector3& pos = avatar->getPositionRegion();
if (region->isOwnedSelf(pos) ||
region->canManageEstate())
{
return true;
}
const LLVector3d& pos_global = avatar->getPositionGlobal();
if (LLWorld::getInstance()->positionRegionValidGlobal(pos_global))
{
LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos_global)->getParcel();
LLViewerParcelMgr::getInstance()->deselectLand();
if (parcel)
{
if (region->isOwnedGroup(pos) &&
(LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_ADMIN) ||
LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_MANAGE_BANNED)))
{
return true;
}
}
}
}
}
}
return false;
}
示例15: find
void LLFloaterHUD::find() // Scanner activated by Scan button
{
if(mHalt) return; // this basically checks if the scan has been toggled on or off otherwise llvoavatar calls the scan on avatar activity
mListNames->deleteAllItems(); //Clear the list
std::vector< LLCharacter* >::iterator avatar_it;
for(avatar_it = LLCharacter::sInstances.begin(); avatar_it != LLCharacter::sInstances.end(); ++avatar_it)
{
LLVOAvatar* avatarp = (LLVOAvatar*)*avatar_it;
if (avatarp->isDead() || avatarp->isSelf()) //Dont show the user!
{
continue;
}
if (dist_vec(avatarp->getPositionAgent(), gAgent.getPositionAgent()) <= SCAN_MAX_RADIUS) //Scanner radius set in indra constants.
{
// Pull in that avatar data!
std::string name = avatarp->getFullname();
LLVector3d position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
LLUUID avid = avatarp->getID();
// Work out distance relative to user!
LLVector3d mypos = gAgent.getPositionGlobal();
LLVector3d delta = position - mypos;
F32 distance = (F32)delta.magVec();
//Build the list
LLSD element;
element["id"] = avid;
element["columns"][LIST_AVATAR_NAME]["column"] = "name";
element["columns"][LIST_AVATAR_NAME]["value"] = name;
element["columns"][LIST_DISTANCE]["column"] = "distance";
element["columns"][LIST_DISTANCE]["value"] = distance;
mListNames->addElement(element);
mListNames->sortByColumn("distance", TRUE);
mListNames->setCallbackUserData(this);
}
}
return;
}