本文整理汇总了C++中LLFloaterWorldMap::trackLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterWorldMap::trackLocation方法的具体用法?C++ LLFloaterWorldMap::trackLocation怎么用?C++ LLFloaterWorldMap::trackLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFloaterWorldMap
的用法示例。
在下文中一共展示了LLFloaterWorldMap::trackLocation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: regionHandleCallback
/* static */
void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport)
{
std::string sim_string = LLSLURL::stripProtocol(url);
std::string region_name;
S32 x = 128;
S32 y = 128;
S32 z = 0;
LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z);
// remap x and y to local coordinates
S32 local_x = x % REGION_WIDTH_UNITS;
S32 local_y = y % REGION_WIDTH_UNITS;
if (local_x < 0)
local_x += REGION_WIDTH_UNITS;
if (local_y < 0)
local_y += REGION_WIDTH_UNITS;
LLVector3 local_pos;
local_pos.mV[VX] = (F32)local_x;
local_pos.mV[VY] = (F32)local_y;
local_pos.mV[VZ] = (F32)z;
LLVector3d global_pos = from_region_handle(region_handle);
global_pos += LLVector3d(local_pos);
if (teleport)
{
gAgent.teleportViaLocation(global_pos);
LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance();
if(instance)
{
instance->trackLocation(global_pos);
}
}
else
{
LLSD key;
key["type"] = "remote_place";
key["x"] = global_pos.mdV[VX];
key["y"] = global_pos.mdV[VY];
key["z"] = global_pos.mdV[VZ];
LLSideTray::getInstance()->showPanel("panel_places", key);
// LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray.
// // display informational floater, allow user to click teleport btn
// LLFloaterURLDisplay* url_displayp = LLFloaterReg::getTypedInstance<LLFloaterURLDisplay>("preview_url",LLSD());
// if(url_displayp)
// {
// url_displayp->displayParcelInfo(region_handle, local_pos);
// if(snapshot_id.notNull())
// {
// url_displayp->setSnapshotDisplay(snapshot_id);
// }
// std::string locationString = llformat("%s %d, %d, %d", region_name.c_str(), x, y, z);
// url_displayp->setLocationString(locationString);
// }
}
}
示例2: onCommitLocation
// static
void LLFloaterWorldMap::onCommitLocation(LLUICtrl* ctrl, void* userdata)
{
LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
if ( LLTracker::TRACKING_LOCATION == tracking_status)
{
LLVector3d pos_global = LLTracker::getTrackedPositionGlobal();
F64 local_x = self->childGetValue("spin x");
F64 local_y = self->childGetValue("spin y");
F64 local_z = self->childGetValue("spin z");
pos_global.mdV[VX] += -fmod(pos_global.mdV[VX], 256.0) + local_x;
pos_global.mdV[VY] += -fmod(pos_global.mdV[VY], 256.0) + local_y;
pos_global.mdV[VZ] = local_z;
self->trackLocation(pos_global);
}
}
示例3: regionHandleCallback
/* static */
void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& slurl, const LLUUID& snapshot_id, bool teleport)
{
// <FS:AW optional opensim support>
#ifndef HAS_OPENSIM_SUPPORT
// we can't teleport cross grid at this point
if( LLGridManager::getInstance()->getGrid(slurl.getGrid())
!= LLGridManager::getInstance()->getGrid())
{
LLSD args;
args["SLURL"] = slurl.getLocationString();
args["CURRENT_GRID"] = LLGridManager::getInstance()->getGridLabel();
args["GRID"] = LLGridManager::getInstance()->getGridLabel(slurl.getGrid());
LLNotificationsUtil::add("CantTeleportToGrid", args);
return;
}
#endif // HAS_OPENSIM_SUPPORT
// </FS:AW optional opensim support>
LLVector3d global_pos = from_region_handle(region_handle);
global_pos += LLVector3d(slurl.getPosition());
if (teleport)
{
gAgent.teleportViaLocation(global_pos);
LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance();
if(instance)
{
instance->trackLocation(global_pos);
}
}
else
{
LLSD key;
key["type"] = "remote_place";
key["x"] = global_pos.mdV[VX];
key["y"] = global_pos.mdV[VY];
key["z"] = global_pos.mdV[VZ];
LLFloaterSidePanelContainer::showPanel("places", key);
}
}
示例4: onCommitSearchResult
// static
void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
{
LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
LLCtrlListInterface *list = self->childGetListInterface("search_results");
if (!list) return;
LLSD selected_value = list->getSelectedValue();
std::string sim_name = selected_value.asString();
if (sim_name.empty())
{
return;
}
LLStringUtil::toLower(sim_name);
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
{
LLSimInfo* info = (*it).second;
std::string info_sim_name = info->mName;
LLStringUtil::toLower(info_sim_name);
if (sim_name == info_sim_name)
{
LLVector3d pos_global = from_region_handle( info->mHandle );
F64 local_x = self->childGetValue("spin x");
F64 local_y = self->childGetValue("spin y");
F64 local_z = self->childGetValue("spin z");
pos_global.mdV[VX] += local_x;
pos_global.mdV[VY] += local_y;
pos_global.mdV[VZ] = local_z;
self->childSetValue("location", sim_name);
self->trackLocation(pos_global);
self->setDefaultBtn("Teleport");
break;
}
}
onShowTargetBtn(self);
}