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


C++ LLVOAvatar::getPositionGlobal方法代码示例

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


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

示例1: 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

示例2: calculateDistance

F32 PanelRadar::calculateDistance(const LLUUID& agent_id, LLVector3d agent_position)
{
	// LL only sends height value up to 1024m, try to work around it if we can by using draw distance
	if (agent_position.mdV[VZ] == 0.0f)
	{
		LLViewerObject *av_obj = gObjectList.findObject(agent_id);
		if (av_obj != NULL && av_obj->isAvatar())
		{
			LLVOAvatar* avatarp = (LLVOAvatar*)av_obj;
			if (avatarp != NULL)
			{
				agent_position = avatarp->getPositionGlobal();
			}
		}
	}
	return F32(dist_vec(agent_position, gAgent.getPositionGlobal())); // don't need F64 here (what dist_vec returns)
}
开发者ID:ArminW,项目名称:imprudence,代码行数:17,代码来源:panelradar.cpp

示例3: 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

示例4: getGlobalPos

LLVector3d LLAvatarTracker::getGlobalPos()
{
	if(!mTrackedAgentValid || !mTrackingData) return LLVector3d();
	LLVector3d global_pos;
	
	LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID);
	if(avatarp && !avatarp->isDead())
	{
		global_pos = avatarp->getPositionGlobal();
		// HACK - for making the tracker point above the avatar's head
		// rather than its groin
		global_pos.mdV[VZ] += 0.7f * avatarp->mBodySize.mV[VZ];

		mTrackingData->mGlobalPositionEstimate = global_pos;
	}
	else
	{
		global_pos = mTrackingData->mGlobalPositionEstimate;
	}

	return global_pos;
}
开发者ID:ap0110,项目名称:SingularityViewer,代码行数:22,代码来源:llcallingcard.cpp

示例5: getDegreesAndDist

void LLAvatarTracker::getDegreesAndDist(F32& rot,
										F64& horiz_dist,
										F64& vert_dist)
{
	if(!mTrackingData) return;

	LLVector3d global_pos;

	LLVOAvatar* avatarp = gObjectList.findAvatar(mTrackingData->mAvatarID);
	if(avatarp && !avatarp->isDead())
	{
		global_pos = avatarp->getPositionGlobal();
		mTrackingData->mGlobalPositionEstimate = global_pos;
	}
	else
	{
		global_pos = mTrackingData->mGlobalPositionEstimate;
	}
	LLVector3d to_vec = global_pos - gAgent.getPositionGlobal();
	horiz_dist = sqrt(to_vec.mdV[VX] * to_vec.mdV[VX] + to_vec.mdV[VY] * to_vec.mdV[VY]);
	vert_dist = to_vec.mdV[VZ];
	rot = F32(RAD_TO_DEG * atan2(to_vec.mdV[VY], to_vec.mdV[VX]));
}
开发者ID:ap0110,项目名称:SingularityViewer,代码行数:23,代码来源:llcallingcard.cpp

示例6: onClickTeleport

//static
void PanelRadar::onClickTeleport(void* user_data)
{
	PanelRadar* self = (PanelRadar*)user_data;
 	LLScrollListItem *item = self->mRadarList->getFirstSelected();

	if (item)
	{
		LLUUID agent_id = item->getUUID();
		std::string agent_name = self->getSelectedName(agent_id);
		if (!agent_name.empty())
		{
			LLViewerObject *av_obj = gObjectList.findObject(agent_id);
			if (av_obj != NULL && av_obj->isAvatar())
			{
				LLVOAvatar* avatarp = (LLVOAvatar*)av_obj;
				if (avatarp != NULL)
				{
					LLVector3d pos = avatarp->getPositionGlobal();
					gAgent.teleportViaLocation(pos);
				}
			}
		}
	}
}
开发者ID:ArminW,项目名称:imprudence,代码行数:25,代码来源:panelradar.cpp

示例7: getAvatars

void LLWorld::getAvatars(std::vector<LLUUID>* avatar_ids, std::vector<LLVector3d>* positions, const LLVector3d& relative_to, F32 radius) const
{
	F32 radius_squared = radius * radius;
	
	if(avatar_ids != NULL)
	{
		avatar_ids->clear();
	}
	if(positions != NULL)
	{
		positions->clear();
	}
	// get the list of avatars from the character list first, so distances are correct
	// when agent is above 1020m and other avatars are nearby
	for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
		iter != LLCharacter::sInstances.end(); ++iter)
	{
		LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter;

		if (!pVOAvatar->isDead() && !pVOAvatar->isSelf() && !pVOAvatar->mIsDummy)
		{
			LLUUID uuid = pVOAvatar->getID();
			if(!uuid.isNull())
			{
				LLVector3d pos_global = pVOAvatar->getPositionGlobal();
				if(dist_vec_squared(pos_global, relative_to) <= radius_squared)
				{
					if(positions != NULL)
					{
						positions->push_back(pos_global);
					}
					if(avatar_ids !=NULL)
					{
						avatar_ids->push_back(uuid);
					}
				}
			}
		}
	}
	// region avatars added for situations where radius is greater than RenderFarClip
	for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
		iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
	{
		LLViewerRegion* regionp = *iter;
		const LLVector3d& origin_global = regionp->getOriginGlobal();
		S32 count = regionp->mMapAvatars.count();
		for (S32 i = 0; i < count; i++)
		{
			LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global);
			if(dist_vec_squared(pos_global, relative_to) <= radius_squared)
			{
				LLUUID uuid = regionp->mMapAvatarIDs.get(i);
				// if this avatar doesn't already exist in the list, add it
				if(uuid.notNull() && avatar_ids != NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end())
				{
					if(positions != NULL)
					{
						positions->push_back(pos_global);
					}
					avatar_ids->push_back(uuid);
				}
			}
		}
	}
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:65,代码来源:llworld.cpp

示例8: getAvatars

void LLWorld::getAvatars(std::vector<LLUUID>* avatar_ids, std::vector<LLVector3d>* positions, const LLVector3d& relative_to, F32 radius) const
{
	if(avatar_ids != NULL)
	{
		avatar_ids->clear();
	}
	if(positions != NULL)
	{
		positions->clear();
	}
	for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
		iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
	{
		LLViewerRegion* regionp = *iter;
		const LLVector3d& origin_global = regionp->getOriginGlobal();
		S32 count = regionp->mMapAvatars.count();
		for (S32 i = 0; i < count; i++)
		{
			LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global);
			if(dist_vec(pos_global, relative_to) <= radius)
			{
				if(positions != NULL)
				{
					positions->push_back(pos_global);
				}
				if(avatar_ids != NULL)
				{
					avatar_ids->push_back(regionp->mMapAvatarIDs.get(i));
				}
			}
		}
	}
	// retrieve the list of close avatars from viewer objects as well
	// for when we are above 1000m, only do this when we are retrieving
	// uuid's too as there could be duplicates
	if(avatar_ids != NULL)
	{
		for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
			iter != LLCharacter::sInstances.end(); ++iter)
		{
			LLVOAvatar* pVOAvatar = (LLVOAvatar*) *iter;
			if(pVOAvatar->isDead() || pVOAvatar->isSelf())
				continue;
			LLUUID uuid = pVOAvatar->getID();
			if(uuid.isNull())
				continue;
			LLVector3d pos_global = pVOAvatar->getPositionGlobal();
			if(dist_vec(pos_global, relative_to) <= radius)
			{
				bool found = false;
				uuid_vec_t::iterator sel_iter = avatar_ids->begin();
				for (; sel_iter != avatar_ids->end(); sel_iter++)
				{
					if(*sel_iter == uuid)
					{
						found = true;
						break;
					}
				}
				if(!found)
				{
					if(positions != NULL)
						positions->push_back(pos_global);
					avatar_ids->push_back(uuid);
				}
			}
		}
	}
}
开发者ID:NickyPerian,项目名称:SingularityViewer,代码行数:69,代码来源:llworld.cpp


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