本文整理汇总了C++中LLViewerRegion::setWaterHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::setWaterHeight方法的具体用法?C++ LLViewerRegion::setWaterHeight怎么用?C++ LLViewerRegion::setWaterHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::setWaterHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processRegionInfo
// static
void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg)
{
llassert(msg);
if (!msg) return;
//const S32 SIM_NAME_BUF = 256;
U64 region_flags;
U8 sim_access;
U8 agent_limit;
std::string sim_name;
U32 estate_id;
U32 parent_estate_id;
F32 water_height;
F32 billable_factor;
F32 object_bonus_factor;
F32 terrain_raise_limit;
F32 terrain_lower_limit;
S32 price_per_meter;
S32 redirect_grid_x;
S32 redirect_grid_y;
LLUUID cache_id;
LLHost host = msg->getSender();
msg->getStringFast(_PREHASH_RegionInfo, _PREHASH_SimName, sim_name);
msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_EstateID, estate_id);
msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_ParentEstateID, parent_estate_id);
msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_SimAccess, sim_access);
msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_MaxAgents, agent_limit);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_ObjectBonusFactor, object_bonus_factor);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_BillableFactor, billable_factor);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, water_height);
if (msg->has(_PREHASH_RegionInfo3))
{
msg->getU64Fast(_PREHASH_RegionInfo3, _PREHASH_RegionFlagsExtended, region_flags);
}
else
{
U32 flags = 0;
msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlags, flags);
region_flags = flags;
}
if (host != gAgent.getRegionHost())
{
// Update is for a different region than the one we're in.
// Just check for a waterheight change.
LLWorld::getInstance()->waterHeightRegionInfo(sim_name, water_height);
return;
}
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainRaiseLimit, terrain_raise_limit);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainLowerLimit, terrain_lower_limit);
msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_PricePerMeter, price_per_meter);
msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_RedirectGridX, redirect_grid_x);
msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_RedirectGridY, redirect_grid_y);
// push values to the current LLViewerRegion
LLViewerRegion *regionp = gAgent.getRegion();
if (regionp)
{
regionp->setRegionNameAndZone(sim_name);
regionp->setRegionFlags(region_flags);
regionp->setSimAccess(sim_access);
regionp->setWaterHeight(water_height);
regionp->setBillableFactor(billable_factor);
}
LLFloaterGodTools* god_tools = LLFloaterReg::getTypedInstance<LLFloaterGodTools>("god_tools");
if (!god_tools) return;
// push values to god tools, if available
if ( gAgent.isGodlike()
&& LLFloaterReg::instanceVisible("god_tools")
&& god_tools->mPanelRegionTools
&& god_tools->mPanelObjectTools)
{
LLPanelRegionTools* rtool = god_tools->mPanelRegionTools;
god_tools->mCurrentHost = host;
// store locally
rtool->setSimName(sim_name);
rtool->setEstateID(estate_id);
rtool->setParentEstateID(parent_estate_id);
rtool->setCheckFlags(region_flags);
rtool->setBillableFactor(billable_factor);
rtool->setPricePerMeter(price_per_meter);
rtool->setRedirectGridX(redirect_grid_x);
rtool->setRedirectGridY(redirect_grid_y);
rtool->enableAllWidgets();
LLPanelObjectTools *otool = god_tools->mPanelObjectTools;
otool->setCheckFlags(region_flags);
otool->enableAllWidgets();
LLViewerRegion *regionp = gAgent.getRegion();
if ( !regionp )
{
//.........这里部分代码省略.........
示例2: processRegionInfo
// static
void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg)
{
LLHost host = msg->getSender();
if (host != gAgent.getRegionHost())
{
// update is for a different region than the one we're in
return;
}
//const S32 SIM_NAME_BUF = 256;
U32 region_flags;
U8 sim_access;
U8 agent_limit;
char sim_name[MAX_STRING]; /*Flawfinder: ignore*/
U32 estate_id;
U32 parent_estate_id;
F32 water_height;
F32 billable_factor;
F32 object_bonus_factor;
F32 terrain_raise_limit;
F32 terrain_lower_limit;
S32 price_per_meter;
S32 redirect_grid_x;
S32 redirect_grid_y;
LLUUID cache_id;
msg->getStringFast(_PREHASH_RegionInfo, _PREHASH_SimName, MAX_STRING, sim_name);
msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_EstateID, estate_id);
msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_ParentEstateID, parent_estate_id);
msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlags, region_flags);
msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_SimAccess, sim_access);
msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_MaxAgents, agent_limit);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_ObjectBonusFactor, object_bonus_factor);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_BillableFactor, billable_factor);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, water_height);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainRaiseLimit, terrain_raise_limit);
msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainLowerLimit, terrain_lower_limit);
msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_PricePerMeter, price_per_meter);
msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_RedirectGridX, redirect_grid_x);
msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_RedirectGridY, redirect_grid_y);
// push values to the current LLViewerRegion
LLViewerRegion *regionp = gAgent.getRegion();
if (regionp)
{
regionp->setRegionNameAndZone(sim_name);
regionp->setRegionFlags(region_flags);
regionp->setSimAccess(sim_access);
regionp->setWaterHeight(water_height);
regionp->setBillableFactor(billable_factor);
}
// push values to god tools, if available
if (sGodTools
&& sGodTools->mPanelRegionTools
&& sGodTools->mPanelObjectTools
&& msg
&& gAgent.isGodlike())
{
LLPanelRegionTools* rtool = sGodTools->mPanelRegionTools;
sGodTools->mCurrentHost = host;
// store locally
rtool->setSimName(sim_name);
rtool->setEstateID(estate_id);
rtool->setParentEstateID(parent_estate_id);
rtool->setCheckFlags(region_flags);
rtool->setBillableFactor(billable_factor);
rtool->setPricePerMeter(price_per_meter);
rtool->setRedirectGridX(redirect_grid_x);
rtool->setRedirectGridY(redirect_grid_y);
rtool->enableAllWidgets();
LLPanelObjectTools *otool = sGodTools->mPanelObjectTools;
otool->setCheckFlags(region_flags);
otool->enableAllWidgets();
LLViewerRegion *regionp = gAgent.getRegion();
if ( !regionp )
{
// -1 implies non-existent
rtool->setGridPosX(-1);
rtool->setGridPosY(-1);
}
else
{
//compute the grid position of the region
LLVector3d global_pos = regionp->getPosGlobalFromRegion(LLVector3::zero);
S32 grid_pos_x = (S32) (global_pos.mdV[VX] / 256.0f);
S32 grid_pos_y = (S32) (global_pos.mdV[VY] / 256.0f);
rtool->setGridPosX(grid_pos_x);
rtool->setGridPosY(grid_pos_y);
}
}
}