本文整理汇总了C++中LLPipeline类的典型用法代码示例。如果您正苦于以下问题:C++ LLPipeline类的具体用法?C++ LLPipeline怎么用?C++ LLPipeline使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLPipeline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: updateTextures
void LLVOTree::updateTextures()
{
if (mTreeImagep)
{
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA))
{
setDebugText(llformat("%4.0f", fsqrtf(mPixelArea)));
}
mTreeImagep->addTextureStats(mPixelArea);
}
}
示例3: createDrawable
LLDrawable* LLVOTree::createDrawable(LLPipeline *pipeline)
{
pipeline->allocDrawable(this);
mDrawable->setLit(FALSE);
mDrawable->setRenderType(LLPipeline::RENDER_TYPE_TREE);
LLDrawPoolTree *poolp = (LLDrawPoolTree*) gPipeline.getPool(LLDrawPool::POOL_TREE, mTreeImagep);
// Just a placeholder for an actual object...
LLFace *facep = mDrawable->addFace(poolp, mTreeImagep);
facep->setSize(1, 3);
updateRadius();
return mDrawable;
}
示例4: 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);
//}
}
}
示例5: mt_ius
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;
}
示例6: 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;
}
示例7: shiftObjects
void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
{
// This is called when we shift our origin when we cross region boundaries...
// We need to update many object caches, I'll document this more as I dig through the code
// cleaning things out...
if (gNoRender || 0 == offset.magVecSquared())
{
return;
}
LLViewerObject *objectp;
for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
{
objectp = *iter;
// There could be dead objects on the object list, so don't update stuff if the object is dead.
if (objectp && !objectp->isDead())
{
objectp->updatePositionCaches();
if (objectp->mDrawable.notNull() && !objectp->mDrawable->isDead())
{
gPipeline.markShift(objectp->mDrawable);
}
}
}
gPipeline.shiftObjects(offset);
LLWorld::getInstance()->shiftRegions(offset);
}
示例8: shiftObjects
void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
{
// This is called when we shift our origin when we cross region boundaries...
// We need to update many object caches, I'll document this more as I dig through the code
// cleaning things out...
if (gNoRender || 0 == offset.magVecSquared())
{
return;
}
LLViewerObject *objectp;
S32 i;
for (i = 0; i < mObjects.count(); i++)
{
objectp = getObject(i);
// There could be dead objects on the object list, so don't update stuff if the object is dead.
if (objectp)
{
objectp->updatePositionCaches();
if (objectp->mDrawable.notNull() && !objectp->mDrawable->isDead())
{
gPipeline.markShift(objectp->mDrawable);
}
}
}
gPipeline.shiftObjects(offset);
gWorldPointer->mPartSim.shift(offset);
}
示例9: setupDrawable
void LLViewerJointAttachment::setupDrawable(LLViewerObject *object)
{
if (!object->mDrawable)
return;
if (object->mDrawable->isActive())
{
object->mDrawable->makeStatic(FALSE);
}
object->mDrawable->mXform.setParent(getXform()); // LLViewerJointAttachment::lazyAttach
object->mDrawable->makeActive();
LLVector3 current_pos = object->getRenderPosition();
LLQuaternion current_rot = object->getRenderRotation();
LLQuaternion attachment_pt_inv_rot = ~(getWorldRotation());
current_pos -= getWorldPosition();
current_pos.rotVec(attachment_pt_inv_rot);
current_rot = current_rot * attachment_pt_inv_rot;
object->mDrawable->mXform.setPosition(current_pos);
object->mDrawable->mXform.setRotation(current_rot);
gPipeline.markMoved(object->mDrawable);
gPipeline.markTextured(object->mDrawable); // face may need to change draw pool to/from POOL_HUD
object->mDrawable->setState(LLDrawable::USE_BACKLIGHT);
if(mIsHUDAttachment)
{
for (S32 face_num = 0; face_num < object->mDrawable->getNumFaces(); face_num++)
{
object->mDrawable->getFace(face_num)->setState(LLFace::HUD_RENDER);
}
}
LLViewerObject::const_child_list_t& child_list = object->getChildren();
for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
iter != child_list.end(); ++iter)
{
LLViewerObject* childp = *iter;
if (childp && childp->mDrawable.notNull())
{
childp->mDrawable->setState(LLDrawable::USE_BACKLIGHT);
gPipeline.markTextured(childp->mDrawable); // face may need to change draw pool to/from POOL_HUD
gPipeline.markMoved(childp->mDrawable);
if(mIsHUDAttachment)
{
for (S32 face_num = 0; face_num < childp->mDrawable->getNumFaces(); face_num++)
{
childp->mDrawable->getFace(face_num)->setState(LLFace::HUD_RENDER);
}
}
}
}
}
示例10: updateCull
void LLSky::updateCull()
{
/*if (mVOSkyp.notNull() && mVOSkyp->mDrawable.notNull())
{
gPipeline.markVisible(mVOSkyp->mDrawable);
}
else
{
llinfos << "No sky drawable!" << llendl;
}*/
if (mVOStarsp.notNull() && mVOStarsp->mDrawable.notNull())
{
gPipeline.markVisible(mVOStarsp->mDrawable, *gCamera);
}
else
{
llinfos << "No stars drawable!" << llendl;
}
/*if (mVOGroundp.notNull() && mVOGroundp->mDrawable.notNull())
{
gPipeline.markVisible(mVOGroundp->mDrawable);
}*/
}
示例11: rebuildWater
//static added one block for openregion ----- voodoo
void LLSurface::rebuildWater()
{
//lldebugs << "Rebuilding Water...";
//BOOL renderwater = gSavedSettings.getBOOL("RenderWater") && LLWorld::getInstance()->getAllowRenderWater();
if(!mWaterObjp.isNull())
//if(prev_renderwater && !renderwater)
{
//lldebugs << "Removing Water";
//Remove the old
gObjectList.killObject(mWaterObjp);
}
if (gSavedSettings.getBOOL("RenderWater") && gHippoLimits->mRenderWater)
//if (!prev_renderwater && renderwater)
{
//lldebugs << "Building Water";
createWaterTexture();
mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
gPipeline.createObject(mWaterObjp);
LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT);
//water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT);
mWaterObjp->setPositionGlobal(water_pos_global);
}
//lldebugs << "Rebuilding Water Complete";
}
示例12: updatePuffs
void LLCloudGroup::updatePuffs(const F32 dt)
{
mDensity = mCloudLayerp->getDensityRegion(mCenterRegion);
if (!mVOCloudsp)
{
mVOCloudsp = (LLVOClouds *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_CLOUDS, mCloudLayerp->getRegion());
if(mVOCloudsp)
{
mVOCloudsp->setCloudGroup(this);
mVOCloudsp->setPositionRegion(mCenterRegion);
mVOCloudsp->setScale(LLVector3(256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH,
256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH,
CLOUD_HEIGHT_RANGE + CLOUD_PUFF_HEIGHT)*0.5f);
gPipeline.createObject(mVOCloudsp);
}
}
LLVector3 velocity;
LLVector3d vel_d;
// Update the positions of all of the clouds
for (U32 i = 0; i < mCloudPuffs.size(); i++)
{
LLCloudPuff &puff = mCloudPuffs[i];
velocity = mCloudLayerp->getRegion()->mWind.getCloudVelocity(mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.mPositionGlobal));
velocity *= CLOUD_VELOCITY_SCALE*CLOUD_UPDATE_RATE;
vel_d.setVec(velocity);
mCloudPuffs[i].mPositionGlobal += vel_d;
mCloudPuffs[i].mAlpha += mCloudPuffs[i].mRate * dt;
mCloudPuffs[i].mAlpha = llmin(1.f, mCloudPuffs[i].mAlpha);
mCloudPuffs[i].mAlpha = llmax(0.f, mCloudPuffs[i].mAlpha);
}
}
示例13: initTextures
void LLSurface::initTextures()
{
///////////////////////
//
// Main surface texture
//
createSTexture();
///////////////////////
//
// Water texture
//
if (gSavedSettings.getBOOL("RenderWater") )
{
createWaterTexture();
mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
gPipeline.createObject(mWaterObjp);
LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
// <FS:CR> Aurora Sim
//water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); // region doesn't have a valid water height yet
water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT);
mWaterObjp->setPositionGlobal(water_pos_global);
// </FS:CR> Aurora Sim
}
}
示例14: renderPickList
void LLViewerObjectList::renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent)
{
gRenderForSelect = TRUE;
gPipeline.renderForSelect(mSelectPickList, render_transparent, screen_rect);
//
// Render pass for selected objects
//
gGL.color4f(1,1,1,1);
gViewerWindow->renderSelections( TRUE, pick_parcel_wall, FALSE );
//fix for DEV-19335. Don't pick hud objects when customizing avatar (camera mode doesn't play nice with nametags).
if (!gAgent.cameraCustomizeAvatar())
{
// render pickable ui elements, like names, etc.
LLHUDObject::renderAllForSelect();
}
gGL.flush();
LLVertexBuffer::unbind();
gRenderForSelect = FALSE;
//llinfos << "Rendered " << count << " for select" << llendl;
//llinfos << "Took " << pick_timer.getElapsedTimeF32()*1000.f << "ms to pick" << llendl;
}
示例15: processUpdateCore
void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
void** user_data,
U32 i,
const EObjectUpdateType update_type,
LLDataPacker* dpp,
BOOL just_created)
{
LLMessageSystem* msg = gMessageSystem;
// ignore returned flags
objectp->processUpdateMessage(msg, user_data, i, update_type, dpp);
if (objectp->isDead())
{
// The update failed
return;
}
updateActive(objectp);
// Also sets the approx. pixel area
objectp->setPixelAreaAndAngle(gAgent);
// Update the image levels of textures for this object.
objectp->updateTextures(gAgent);
if (just_created)
{
gPipeline.addObject(objectp);
}
else
{
primbackup::getInstance()->prim_update(objectp);
}
// RN: this must be called after we have a drawable
// (from gPipeline.addObject)
// so that the drawable parent is set properly
findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort());
// If we're just wandering around, don't create new objects selected.
if (just_created
&& update_type != OUT_TERSE_IMPROVED
&& objectp->mCreateSelected)
{
if ( gToolMgr->getCurrentTool() != gToolPie )
{
//llinfos << "DEBUG selecting " << objectp->mID << " "
// << objectp->mLocalID << llendl;
gSelectMgr->selectObjectAndFamily(objectp);
dialog_refresh_all();
}
objectp->mCreateSelected = false;
gViewerWindow->getWindow()->decBusyCount();
gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW );
primbackup::getInstance()->newprim(objectp);
}
}