コード例 #1
0
void LLFloaterTopObjects::onTP(void* data)
{
    LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
    if (!list) return;
    LLScrollListItem* first_selected = list->getFirstSelected();
    if (!first_selected) return;

    std::string name = first_selected->getColumn(1)->getValue().asString();
    std::string pos_string =  first_selected->getColumn(3)->getValue().asString();

    F32 x, y, z;
    S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z);
    if (matched != 3) return;

    LLVector3 pos_agent(x, y, z);
    LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent);

    gAgent.teleportViaLocation( pos_global );
}
コード例 #2
0
void LLFloaterTopObjects::showBeacon()
{
	LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
	if (!list) return;

	LLScrollListItem* first_selected = list->getFirstSelected();
	if (!first_selected) return;

	std::string name = first_selected->getColumn(1)->getValue().asString();
	std::string pos_string =  first_selected->getColumn(3)->getValue().asString();

	F32 x, y, z;
	S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z);
	if (matched != 3) return;

	LLVector3 pos_agent(x, y, z);
	LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent);
	std::string tooltip("");
	LLTracker::trackLocation(pos_global, name, tooltip, LLTracker::LOCATION_ITEM);
}