本文整理汇总了C++中LLPipeline::hasRenderType方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPipeline::hasRenderType方法的具体用法?C++ LLPipeline::hasRenderType怎么用?C++ LLPipeline::hasRenderType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPipeline
的用法示例。
在下文中一共展示了LLPipeline::hasRenderType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: idleUpdate
BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TREE)))
{
return TRUE;
}
S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS ;
F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor;
for (S32 j = 0; j < sMAX_NUM_TREE_LOD_LEVELS; j++)
{
if (app_angle > LLVOTree::sLODAngles[j])
{
trunk_LOD = j;
break;
}
}
if (mReferenceBuffer.isNull())
{
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
}
else if (trunk_LOD != mTrunkLOD)
{
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE);
}
else
{
// we're not animating but we may *still* need to
// regenerate the mesh if we moved, since position
// and rotation are baked into the mesh.
// *TODO: I don't know what's so special about trees
// that they don't get REBUILD_POSITION automatically
// at a higher level.
const LLVector3 &this_position = getPositionAgent();
if (this_position != mLastPosition)
{
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
mLastPosition = this_position;
}
else
{
const LLQuaternion &this_rotation = getRotation();
if (this_rotation != mLastRotation)
{
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
mLastRotation = this_rotation;
}
}
}
mTrunkLOD = trunk_LOD;
return TRUE;
}
示例2: updateSky
void LLSky::updateSky()
{
if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_SKY))
{
return;
}
if (mVOSkyp)
{
mVOSkyp->updateSky();
}
if (mVOStarsp)
{
//if (mVOStarsp->mDrawable)
//{
// gPipeline.markRebuild(mVOStarsp->mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
//}
}
}
示例3: idleUpdate
BOOL LLSurface::idleUpdate(F32 max_update_time)
{
LLMemType mt_ius(LLMemType::MTYPE_IDLE_UPDATE_SURFACE);
if (!gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TERRAIN))
{
return FALSE;
}
// Perform idle time update of non-critical stuff.
// In this case, texture and normal updates.
LLTimer update_timer;
BOOL did_update = FALSE;
// If the Z height data has changed, we need to rebuild our
// property line vertex arrays.
if (mDirtyPatchList.size() > 0)
{
getRegion()->dirtyHeights();
}
// Always call updateNormals() / updateVerticalStats()
// every frame to avoid artifacts
for(std::set<LLSurfacePatch *>::iterator iter = mDirtyPatchList.begin();
iter != mDirtyPatchList.end(); )
{
std::set<LLSurfacePatch *>::iterator curiter = iter++;
LLSurfacePatch *patchp = *curiter;
patchp->updateNormals();
patchp->updateVerticalStats();
if (max_update_time == 0.f || update_timer.getElapsedTimeF32() < max_update_time)
{
if (patchp->updateTexture())
{
did_update = TRUE;
patchp->clearDirty();
mDirtyPatchList.erase(curiter);
}
}
}
return did_update;
}
示例4: idleUpdate
BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
const U16 FRAMES_PER_WIND_UPDATE = 20; // How many frames between wind update per tree
const F32 TREE_WIND_SENSITIVITY = 0.005f;
const F32 TREE_TRUNK_STIFFNESS = 0.1f;
if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TREE)))
{
return TRUE;
}
F32 mass_inv;
// For all tree objects, update the trunk bending with the current wind
// Walk sprite list in order away from viewer
if (!(mFrameCount % FRAMES_PER_WIND_UPDATE))
{
// If needed, Get latest wind for this tree
mWind = mRegionp->mWind.getVelocity(getPositionRegion());
}
mFrameCount++;
mass_inv = 1.f/(5.f + mDepth*mBranches*0.2f);
mTrunkVel += (mWind * mass_inv * TREE_WIND_SENSITIVITY); // Pull in direction of wind
mTrunkVel -= (mTrunkBend * mass_inv * TREE_TRUNK_STIFFNESS); // Restoring force in direction of trunk
mTrunkBend += mTrunkVel;
mTrunkVel *= 0.99f; // Add damping
if (mTrunkBend.magVec() > 1.f)
{
mTrunkBend.normVec();
}
if (mTrunkVel.magVec() > 1.f)
{
mTrunkVel.normVec();
}
return TRUE;
}
示例5: idleUpdate
BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
{
const U16 FRAMES_PER_WIND_UPDATE = 20; // How many frames between wind update per tree
const F32 TREE_WIND_SENSITIVITY = 0.005f;
const F32 TREE_TRUNK_STIFFNESS = 0.1f;
if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TREE)))
{
return TRUE;
}
//it's cheaper to check if wind is enabled first
if (gLLWindEnabled && gSavedSettings.getBOOL("RenderAnimateTrees"))
{
F32 mass_inv;
// For all tree objects, update the trunk bending with the current wind
// Walk sprite list in order away from viewer
if (!(mFrameCount % FRAMES_PER_WIND_UPDATE))
{
// If needed, Get latest wind for this tree
mWind = mRegionp->mWind.getVelocity(getPositionRegion());
}
mFrameCount++;
mass_inv = 1.f/(5.f + mDepth*mBranches*0.2f);
mTrunkVel += (mWind * mass_inv * TREE_WIND_SENSITIVITY); // Pull in direction of wind
mTrunkVel -= (mTrunkBend * mass_inv * TREE_TRUNK_STIFFNESS); // Restoring force in direction of trunk
mTrunkBend += mTrunkVel;
mTrunkVel *= 0.99f; // Add damping
if (mTrunkBend.length() > 1.f)
{
mTrunkBend.normalize();
}
if (mTrunkVel.length() > 1.f)
{
mTrunkVel.normalize();
}
}
S32 trunk_LOD = 0;
F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor;
for (S32 j = 0; j < 4; j++)
{
if (app_angle > LLVOTree::sLODAngles[j])
{
trunk_LOD = j;
break;
}
}
if (!gLLWindEnabled || !gSavedSettings.getBOOL("RenderAnimateTrees"))
{
if (mReferenceBuffer.isNull())
{
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
}
else if (trunk_LOD != mTrunkLOD)
{
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE);
}
else
{
// we're not animating but we may *still* need to
// regenerate the mesh if we moved, since position
// and rotation are baked into the mesh.
// *TODO: I don't know what's so special about trees
// that they don't get REBUILD_POSITION automatically
// at a higher level.
const LLVector3 &this_position = getPositionAgent();
if (this_position != mLastPosition)
{
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
mLastPosition = this_position;
}
else
{
const LLQuaternion &this_rotation = getRotation();
if (this_rotation != mLastRotation)
{
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
mLastRotation = this_rotation;
}
}
}
}
mTrunkLOD = trunk_LOD;
return TRUE;
}