本文整理汇总了C++中LLSimInfo::insertAgentLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSimInfo::insertAgentLocation方法的具体用法?C++ LLSimInfo::insertAgentLocation怎么用?C++ LLSimInfo::insertAgentLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSimInfo
的用法示例。
在下文中一共展示了LLSimInfo::insertAgentLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertItem
//.........这里部分代码省略.........
case MAP_ITEM_TELEHUB: // telehubs
{
/* Merov: we are not using the hub color anymore for display so commenting that out
// Telehub color
U32 X = x_world / REGION_WIDTH_UNITS;
U32 Y = y_world / REGION_WIDTH_UNITS;
F32 red = fmod((F32)X * 0.11f, 1.f) * 0.8f;
F32 green = fmod((F32)Y * 0.11f, 1.f) * 0.8f;
F32 blue = fmod(1.5f * (F32)(X + Y) * 0.11f, 1.f) * 0.8f;
F32 add_amt = (X % 2) ? 0.15f : -0.15f;
add_amt += (Y % 2) ? -0.15f : 0.15f;
LLColor4 color(red + add_amt, green + add_amt, blue + add_amt);
new_item.setColor(color);
*/
// extra2 specifies whether this is an infohub or a telehub.
if (extra2)
{
siminfo->insertInfoHub(new_item);
}
else
{
siminfo->insertTeleHub(new_item);
}
break;
}
case MAP_ITEM_PG_EVENT: // events
case MAP_ITEM_MATURE_EVENT:
case MAP_ITEM_ADULT_EVENT:
{
struct tm* timep;
// Convert to Pacific, based on server's opinion of whether
// it's daylight savings time there.
timep = utc_to_pacific_time(extra, gPacificDaylightTime);
S32 display_hour = timep->tm_hour % 12;
if (display_hour == 0) display_hour = 12;
std::string tooltip = llformat( "%d:%02d %s",
display_hour,
timep->tm_min,
(timep->tm_hour < 12 ? "AM" : "PM") );
new_item.setTooltip(tooltip);
// HACK: store Z in extra2
new_item.setElevation((F64)extra2);
if (type == MAP_ITEM_PG_EVENT)
{
siminfo->insertPGEvent(new_item);
}
else if (type == MAP_ITEM_MATURE_EVENT)
{
siminfo->insertMatureEvent(new_item);
}
else if (type == MAP_ITEM_ADULT_EVENT)
{
siminfo->insertAdultEvent(new_item);
}
break;
}
case MAP_ITEM_LAND_FOR_SALE: // land for sale
case MAP_ITEM_LAND_FOR_SALE_ADULT: // adult land for sale
{
F32 cost_per_sqm = 0.0f;
if (extra > 0)
{
cost_per_sqm = (F32)extra2 / (F32)extra;
}
std::string tooltip = llformat("%d sq.m. L$%d (L$ %.1f/sq.m.)", extra, extra2, cost_per_sqm);
new_item.setTooltip(tooltip);
if (type == MAP_ITEM_LAND_FOR_SALE)
{
siminfo->insertLandForSale(new_item);
}
else if (type == MAP_ITEM_LAND_FOR_SALE_ADULT)
{
siminfo->insertLandForSaleAdult(new_item);
}
break;
}
case MAP_ITEM_CLASSIFIED: // classifieds
{
//DEPRECATED: no longer used
break;
}
case MAP_ITEM_AGENT_LOCATIONS: // agent locations
{
// LL_INFOS("World Map") << "New Location " << new_item.mName << LL_ENDL;
if (extra > 0)
{
new_item.setCount(extra);
siminfo->insertAgentLocation(new_item);
}
break;
}
default:
break;
}
return true;
}