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


C++ LLLandmark类代码示例

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


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

示例1: file

// static
void LLLandmarkList::processGetAssetReply(
	LLVFS *vfs,
	const LLUUID& uuid,
	LLAssetType::EType type,
	void* user_data,
	S32 status)
{
	if( status == 0 )
	{
		LLVFile file(vfs, uuid, type);
		S32 file_length = file.getSize();

		char* buffer = new char[ file_length + 1 ];
		file.read( (U8*)buffer, file_length);		/*Flawfinder: ignore*/
		buffer[ file_length ] = 0;

		LLLandmark* landmark = LLLandmark::constructFromString(buffer);
		if (landmark)
		{
			LLVector3d pos;
			if(!landmark->getGlobalPos(pos))
			{
				LLUUID region_id;
				if(landmark->getRegionID(region_id))
				{
					LLLandmark::requestRegionHandle(
						gMessageSystem,
						gAgent.getRegionHost(),
						region_id,
						NULL);
				}
			}
			gLandmarkList.mList[ uuid ] = landmark;
		}

		delete[] buffer;
	}
	else
	{
		if( gViewerStats )
		{
			gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
		}

		if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status )
		{
			LLNotifyBox::showXml("LandmarkMissing");
		}
		else
		{
			LLNotifyBox::showXml("UnableToLoadLandmark");
		}

		gLandmarkList.mBadList.insert(uuid);
	}

}
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:58,代码来源:lllandmarklist.cpp

示例2: getCurrentInfoPanel

void LLPanelPlaces::onShowOnMapButtonClicked()
{
	LLPanelPlaceInfo* panel = getCurrentInfoPanel();
	if (panel && panel->getVisible())
	{
		LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
		if(!worldmap_instance)
			return;

		if (mPlaceInfoType == AGENT_INFO_TYPE ||
			mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE ||
			mPlaceInfoType == REMOTE_PLACE_INFO_TYPE ||
			mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE)
		{
			if (!mPosGlobal.isExactlyZero())
			{
				worldmap_instance->trackLocation(mPosGlobal);
				LLFloaterReg::showInstance("world_map", "center");
			}
		}
		else if (mPlaceInfoType == LANDMARK_INFO_TYPE)
		{
			LLLandmark* landmark = gLandmarkList.getAsset(mItem->getAssetUUID());
			if (!landmark)
				return;

			LLVector3d landmark_global_pos;
			if (!landmark->getGlobalPos(landmark_global_pos))
				return;
			
			if (!landmark_global_pos.isExactlyZero())
			{
				worldmap_instance->trackLocation(landmark_global_pos);
				LLFloaterReg::showInstance("world_map", "center");
			}
		}
	}
	else
	{
		if (mActivePanel && mActivePanel->isSingleItemSelected())
		{
			mActivePanel->onShowOnMap();
		}
		else
		{
			LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
			LLVector3d global_pos = gAgent.getPositionGlobal();

			if (!global_pos.isExactlyZero() && worldmap_instance)
			{
				worldmap_instance->trackLocation(global_pos);
				LLFloaterReg::showInstance("world_map", "center");
			}
		}
	}
}
开发者ID:otwstephanie,项目名称:hpa2oar,代码行数:56,代码来源:llpanelplaces.cpp

示例3: cacheLandmarkPosition

void LLTracker::cacheLandmarkPosition()
{
	// the landmark asset download may have finished, in which case
	// we'll now be able to figure out where we're trying to go
	BOOL found_landmark = FALSE;
	if( mTrackedLandmarkAssetID == LLFloaterWorldMap::getHomeID())
	{
		LLVector3d pos_global;
		if ( gAgent.getHomePosGlobal( &mTrackedPositionGlobal ))
		{
			found_landmark = TRUE;
		}
		else
		{
			llwarns << "LLTracker couldn't find home pos" << llendl;
			mTrackedLandmarkAssetID.setNull();
			mTrackedLandmarkItemID.setNull();
		}
	}
	else
	{
		LLLandmark* landmark = gLandmarkList.getAsset(mTrackedLandmarkAssetID);
		if(landmark && landmark->getGlobalPos(mTrackedPositionGlobal))
		{
			found_landmark = TRUE;

			// cache the object's visitation status
			mLandmarkHasBeenVisited = FALSE;
			LLInventoryItem* item = gInventory.getItem(mTrackedLandmarkItemID);
			if (   item 
				&& item->getFlags()&LLInventoryItem::II_FLAGS_LANDMARK_VISITED)
			{
				mLandmarkHasBeenVisited = TRUE;
			}
		}
	}
	if ( found_landmark && gFloaterWorldMap )
	{
		mHasReachedLandmark = FALSE;
		F32 dist = gFloaterWorldMap->getDistanceToDestination(mTrackedPositionGlobal, 1.0f);
		if ( dist < DESTINATION_UNVISITED_RADIUS )
		{
			mHasReachedLandmark = TRUE;
		}
		mHasLandmarkPosition = TRUE;
	}
	mHasLandmarkPosition = found_landmark;
}
开发者ID:Nora28,项目名称:imprudence,代码行数:48,代码来源:lltracker.cpp

示例4: get_ptr_in_map

LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t cb)
{
	LLLandmark* landmark = get_ptr_in_map(mList, asset_uuid);
	if(landmark)
	{
		LLVector3d dummy;
		if(cb && !landmark->getGlobalPos(dummy))
		{
			// landmark is not completely loaded yet
			loaded_callback_map_t::value_type vt(asset_uuid, cb);
			mLoadedCallbackMap.insert(vt);
		}
		return landmark;
	}
	else
	{
	    if ( mBadList.find(asset_uuid) != mBadList.end() )
		{
			return NULL;
		}
		
		landmark_requested_list_t::iterator iter = mRequestedList.find(asset_uuid);
		if (iter != mRequestedList.end())
		{
			const F32 rerequest_time = 30.f; // 30 seconds between requests
			if (gFrameTimeSeconds - iter->second < rerequest_time)
			{
				return NULL;
			}
		}
		
		if (cb)
		{
			loaded_callback_map_t::value_type vt(asset_uuid, cb);
			mLoadedCallbackMap.insert(vt);
		}

		gAssetStorage->getAssetData(asset_uuid,
									LLAssetType::AT_LANDMARK,
									LLLandmarkList::processGetAssetReply,
									NULL);
		mRequestedList[asset_uuid] = gFrameTimeSeconds;
	}
	return NULL;
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:45,代码来源:lllandmarklist.cpp

示例5: getAsset

void LLLandmarkList::onRegionHandle(const LLUUID& landmark_id)
{
	LLLandmark* landmark = getAsset(landmark_id);

	if (!landmark)
	{
		LL_WARNS() << "Got region handle but the landmark not found." << LL_ENDL;
		return;
	}

	// Calculate landmark global position.
	// This should succeed since the region handle is available.
	LLVector3d pos;
	if (!landmark->getGlobalPos(pos))
	{
		LL_WARNS() << "Got region handle but the landmark global position is still unknown." << LL_ENDL;
		return;
	}

	makeCallbacks(landmark_id);
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:21,代码来源:lllandmarklist.cpp

示例6: file

// static
void LLLandmarkList::processGetAssetReply(
	LLVFS *vfs,
	const LLUUID& uuid,
	LLAssetType::EType type,
	void* user_data,
	S32 status, 
	LLExtStat ext_status )
{
	if( status == 0 )
	{
		LLVFile file(vfs, uuid, type);
		S32 file_length = file.getSize();

		std::vector<char> buffer(file_length + 1);
		file.read( (U8*)&buffer[0], file_length);
		buffer[ file_length ] = 0;

		LLLandmark* landmark = LLLandmark::constructFromString(&buffer[0]);
		if (landmark)
		{
			gLandmarkList.mList[ uuid ] = landmark;
			gLandmarkList.mRequestedList.erase(uuid);
			
			LLVector3d pos;
			if(!landmark->getGlobalPos(pos))
			{
				LLUUID region_id;
				if(landmark->getRegionID(region_id))
				{
					LLLandmark::requestRegionHandle(
						gMessageSystem,
						gAgent.getRegionHost(),
						region_id,
						boost::bind(&LLLandmarkList::onRegionHandle, &gLandmarkList, uuid));
				}

				// the callback will be called when we get the region handle.
			}
			else
			{
				gLandmarkList.makeCallbacks(uuid);
			}
		}
	}
	else
	{
		LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );

		if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status )
		{
			LLNotificationsUtil::add("LandmarkMissing");
		}
		else
		{
			LLNotificationsUtil::add("UnableToLoadLandmark");
		}

		gLandmarkList.mBadList.insert(uuid);
	}

}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:62,代码来源:lllandmarklist.cpp


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