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


C++ LLVOAvatar类代码示例

本文整理汇总了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();
		}
	}
}
开发者ID:arsenico,项目名称:SingularityViewer,代码行数:18,代码来源:llwearable.cpp

示例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;
}
开发者ID:Boy,项目名称:rainbow,代码行数:21,代码来源:llfloateranimpreview.cpp

示例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;
		}
	}
}
开发者ID:blipvert,项目名称:phoenix-sg,代码行数:46,代码来源:llwearable.cpp

示例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();
			}
		}
	}
}
开发者ID:fractured-crystal,项目名称:SingularityViewer,代码行数:47,代码来源:llfloateranimpreview.cpp

示例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);
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:15,代码来源:lltoolmorph.cpp

示例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());
			}
		}
	}
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:19,代码来源:llwearable.cpp

示例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)));
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:43,代码来源:llpanelcontents.cpp

示例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);
		}
	}
}
开发者ID:Xara,项目名称:Opensource-V2-SL-Viewer,代码行数:20,代码来源:llpreviewanim.cpp

示例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() + ")");
	}
}
开发者ID:HanHeld,项目名称:SingularityViewerFeb2016,代码行数:20,代码来源:llfloateravatartextures.cpp

示例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);
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:23,代码来源:llmorphview.cpp

示例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 );
    }
}
开发者ID:radegastdev,项目名称:EffervescenceViewer,代码行数:20,代码来源:llfloatertopobjects.cpp

示例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();
}
开发者ID:fractured-crystal,项目名称:SingularityViewer,代码行数:37,代码来源:llfloateranimpreview.cpp

示例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;
		}
	}
}
开发者ID:Xara,项目名称:Meerkat-Viewer,代码行数:29,代码来源:llfloateranimpreview.cpp

示例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;	
}
开发者ID:ArminW,项目名称:imprudence,代码行数:40,代码来源:panelradar.cpp

示例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;	
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:54,代码来源:llfloaterhud.cpp


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