当前位置: 首页>>代码示例>>C++>>正文


C++ LLPipeline::hasRenderType方法代码示例

本文整理汇总了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;
}
开发者ID:dtshady,项目名称:SingularityViewer,代码行数:57,代码来源:llvotree.cpp

示例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);
		//}
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:18,代码来源:llsky.cpp

示例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;
}
开发者ID:wish-ds,项目名称:firestorm-ds,代码行数:41,代码来源:llsurface.cpp

示例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;
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:40,代码来源:llvotree.cpp

示例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;
}
开发者ID:HazimGazov,项目名称:Sausages,代码行数:96,代码来源:llvotree.cpp


注:本文中的LLPipeline::hasRenderType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。