本文整理汇总了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);
}
}
示例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");
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}