本文整理汇总了C++中LLViewerRegion::getCenterGlobal方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::getCenterGlobal方法的具体用法?C++ LLViewerRegion::getCenterGlobal怎么用?C++ LLViewerRegion::getCenterGlobal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::getCenterGlobal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_map_url
std::string get_map_url()
{
LLVector3d center_agent;
LLViewerRegion *regionp = gAgent.getRegion();
if (regionp)
{
center_agent = regionp->getCenterGlobal();
}
int x_pos = center_agent[0] / 256.0;
int y_pos = center_agent[1] / 256.0;
std::string map_url = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-1-%d-%d-objects.jpg", x_pos, y_pos);
return map_url;
}
示例2: printPacketsLost
void LLWorld::printPacketsLost()
{
llinfos << "Simulators:" << llendl;
llinfos << "----------" << llendl;
LLCircuitData *cdp = NULL;
for (region_list_t::iterator iter = mActiveRegionList.begin();
iter != mActiveRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
cdp = gMessageSystem->mCircuitInfo.findCircuit(regionp->getHost());
if (cdp)
{
LLVector3d range = regionp->getCenterGlobal() - gAgent.getPositionGlobal();
llinfos << regionp->getHost() << ", range: " << range.length()
<< " packets lost: " << cdp->getPacketsLost() << llendl;
}
}
}
示例3: StartRequestChain
BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
{
LLUUID region_id;
LLFloaterLand* instance = LLFloaterReg::getTypedInstance<LLFloaterLand>("about_land");
if(!instance)
{
childSetValue("loading_text", LLSD(std::string("")));
//might have to do parent post build here
//if not logic below could use early outs
return FALSE;
}
LLParcel* parcel = instance->getCurrentSelectedParcel();
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
LLUUID current_region_id = gAgent.getRegion()->getRegionID();
if ((region) && (parcel))
{
LLVector3 parcel_center = parcel->getCenterpoint();
region_id = region->getRegionID();
if(region_id != current_region_id)
{
std::string msg_wrong_region = LLTrans::getString("ScriptLimitsRequestWrongRegion");
childSetValue("loading_text", LLSD(msg_wrong_region));
return FALSE;
}
LLVector3d pos_global = region->getCenterGlobal();
LLSD body;
std::string url = region->getCapability("RemoteParcelRequest");
if (!url.empty())
{
body["location"] = ll_sd_from_vector3(parcel_center);
if (!region_id.isNull())
{
body["region_id"] = region_id;
}
if (!pos_global.isExactlyZero())
{
U64 region_handle = to_region_handle(pos_global);
body["region_handle"] = ll_sd_from_U64(region_handle);
}
LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(getObserverHandle()));
}
else
{
llwarns << "Can't get parcel info for script information request" << region_id
<< ". Region: " << region->getName()
<< " does not support RemoteParcelRequest" << llendl;
std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
childSetValue("loading_text", LLSD(msg_waiting));
}
}
else
{
std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestNoParcelSelected");
childSetValue("loading_text", LLSD(msg_waiting));
}
return LLPanelScriptLimitsInfo::postBuild();
}
示例4: StartRequestChain
BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
{
LLUUID region_id;
LLFloaterLand* instance = LLFloaterLand::getInstance();
if(!instance)
{
getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string("")));
//might have to do parent post build here
//if not logic below could use early outs
return FALSE;
}
LLParcel* parcel = instance->getCurrentSelectedParcel();
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
LLUUID current_region_id = gAgent.getRegion()->getRegionID();
// <alchemy> Fall back to the parcel we're on if none is selected.
// Fixes parcel script info intermittently working and broken in toolbar button.
if (!parcel)
{
parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
region = gAgent.getRegion();
}
// </alchemy>
if ((region) && (parcel))
{
LLVector3 parcel_center = parcel->getCenterpoint();
region_id = region->getRegionID();
if(region_id != current_region_id)
{
std::string msg_wrong_region = LLTrans::getString("ScriptLimitsRequestWrongRegion");
getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_wrong_region));
return FALSE;
}
LLVector3d pos_global = region->getCenterGlobal();
LLSD body;
std::string url = region->getCapability("RemoteParcelRequest");
if (!url.empty())
{
body["location"] = ll_sd_from_vector3(parcel_center);
if (!region_id.isNull())
{
body["region_id"] = region_id;
}
if (!pos_global.isExactlyZero())
{
U64 region_handle = to_region_handle(pos_global);
body["region_handle"] = ll_sd_from_U64(region_handle);
}
LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(getObserverHandle()));
}
else
{
LL_WARNS() << "Can't get parcel info for script information request" << region_id
<< ". Region: " << region->getName()
<< " does not support RemoteParcelRequest" << LL_ENDL;
std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting));
}
}
else
{
std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestNoParcelSelected");
getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting));
}
return LLPanelScriptLimitsInfo::postBuild();
}