本文整理汇总了C++中LLViewerRegion::forceUpdate方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::forceUpdate方法的具体用法?C++ LLViewerRegion::forceUpdate怎么用?C++ LLViewerRegion::forceUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::forceUpdate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: modifyLandInSelectionGlobal
//.........这里部分代码省略.........
iter != mLastAffectedRegions.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
//BOOL is_changed = FALSE;
LLVector3 min_region = regionp->getPosRegionFromGlobal(min);
LLVector3 max_region = regionp->getPosRegionFromGlobal(max);
min_region.clamp(0.f, regionp->getWidth());
max_region.clamp(0.f, regionp->getWidth());
F32 seconds = gSavedSettings.getF32("LandBrushForce");
LLSurface &land = regionp->getLand();
char action = E_LAND_LEVEL;
switch (radioAction)
{
case 0:
// // average toward mStartingZ
action = E_LAND_LEVEL;
seconds *= 0.25f;
break;
case 1:
action = E_LAND_RAISE;
seconds *= 0.25f;
break;
case 2:
action = E_LAND_LOWER;
seconds *= 0.25f;
break;
case 3:
action = E_LAND_SMOOTH;
seconds *= 5.0f;
break;
case 4:
action = E_LAND_NOISE;
seconds *= 0.5f;
break;
case 5:
action = E_LAND_REVERT;
seconds = 0.5f;
break;
default:
//action = E_LAND_INVALID;
//seconds = 0.0f;
return;
break;
}
// Don't send a message to the region if nothing changed.
//if(!is_changed) continue;
// Now to update the patch information so it will redraw correctly.
LLSurfacePatch *patchp= land.resolvePatchRegion(min_region);
if (patchp)
{
patchp->dirtyZ();
}
// Also force the property lines to update, normals to recompute, etc.
regionp->forceUpdate();
// tell the simulator what we've done
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ModifyLand);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ModifyBlock);
msg->addU8Fast(_PREHASH_Action, (U8)action);
msg->addU8Fast(_PREHASH_BrushSize, getBrushIndex());
msg->addF32Fast(_PREHASH_Seconds, seconds);
msg->addF32Fast(_PREHASH_Height, mStartingZ);
BOOL parcel_selected = LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected();
LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel();
if (parcel_selected && selected_parcel)
{
msg->nextBlockFast(_PREHASH_ParcelData);
msg->addS32Fast(_PREHASH_LocalID, selected_parcel->getLocalID());
msg->addF32Fast(_PREHASH_West, min_region.mV[VX] );
msg->addF32Fast(_PREHASH_South, min_region.mV[VY] );
msg->addF32Fast(_PREHASH_East, max_region.mV[VX] );
msg->addF32Fast(_PREHASH_North, max_region.mV[VY] );
}
else
{
msg->nextBlockFast(_PREHASH_ParcelData);
msg->addS32Fast(_PREHASH_LocalID, -1);
msg->addF32Fast(_PREHASH_West, min_region.mV[VX] );
msg->addF32Fast(_PREHASH_South, min_region.mV[VY] );
msg->addF32Fast(_PREHASH_East, max_region.mV[VX] );
msg->addF32Fast(_PREHASH_North, max_region.mV[VY] );
}
msg->nextBlock("ModifyBlockExtended");
msg->addF32("BrushSize", mBrushSize);
msg->sendMessage(regionp->getHost());
}
}
示例2: modifyLandAtPointGlobal
void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global,
MASK mask)
{
S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction");
mLastAffectedRegions.clear();
determineAffectedRegions(mLastAffectedRegions, pos_global);
for(region_list_t::iterator iter = mLastAffectedRegions.begin();
iter != mLastAffectedRegions.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
//BOOL is_changed = FALSE;
LLVector3 pos_region = regionp->getPosRegionFromGlobal(pos_global);
LLSurface &land = regionp->getLand();
char action = E_LAND_LEVEL;
switch (radioAction)
{
case 0:
// // average toward mStartingZ
action = E_LAND_LEVEL;
break;
case 1:
action = E_LAND_RAISE;
break;
case 2:
action = E_LAND_LOWER;
break;
case 3:
action = E_LAND_SMOOTH;
break;
case 4:
action = E_LAND_NOISE;
break;
case 5:
action = E_LAND_REVERT;
break;
default:
action = E_LAND_INVALID;
break;
}
// Don't send a message to the region if nothing changed.
//if(!is_changed) continue;
// Now to update the patch information so it will redraw correctly.
LLSurfacePatch *patchp= land.resolvePatchRegion(pos_region);
if (patchp)
{
patchp->dirtyZ();
}
// Also force the property lines to update, normals to recompute, etc.
regionp->forceUpdate();
// tell the simulator what we've done
F32 seconds = (1.0f / gFPSClamped) * gSavedSettings.getF32("LandBrushForce");
F32 x_pos = (F32)pos_region.mV[VX];
F32 y_pos = (F32)pos_region.mV[VY];
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ModifyLand);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ModifyBlock);
msg->addU8Fast(_PREHASH_Action, (U8)action);
msg->addU8Fast(_PREHASH_BrushSize, getBrushIndex());
msg->addF32Fast(_PREHASH_Seconds, seconds);
msg->addF32Fast(_PREHASH_Height, mStartingZ);
msg->nextBlockFast(_PREHASH_ParcelData);
msg->addS32Fast(_PREHASH_LocalID, -1);
msg->addF32Fast(_PREHASH_West, x_pos );
msg->addF32Fast(_PREHASH_South, y_pos );
msg->addF32Fast(_PREHASH_East, x_pos );
msg->addF32Fast(_PREHASH_North, y_pos );
msg->nextBlock("ModifyBlockExtended");
msg->addF32("BrushSize", mBrushSize);
msg->sendMessage(regionp->getHost());
}
}