本文整理汇总了C++中LLViewerRegion::getParcelOverlay方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::getParcelOverlay方法的具体用法?C++ LLViewerRegion::getParcelOverlay怎么用?C++ LLViewerRegion::getParcelOverlay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::getParcelOverlay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderOwnership
void LLDrawPoolTerrain::renderOwnership()
{
LLGLSPipelineAlpha gls_pipeline_alpha;
llassert(!mDrawFace.empty());
// Each terrain pool is associated with a single region.
// We need to peek back into the viewer's data to find out
// which ownership overlay texture to use.
LLFace *facep = mDrawFace[0];
LLDrawable *drawablep = facep->getDrawable();
const LLViewerObject *objectp = drawablep->getVObj();
const LLVOSurfacePatch *vo_surface_patchp = (LLVOSurfacePatch *)objectp;
LLSurfacePatch *surface_patchp = vo_surface_patchp->getPatch();
LLSurface *surfacep = surface_patchp->getSurface();
LLViewerRegion *regionp = surfacep->getRegion();
LLViewerParcelOverlay *overlayp = regionp->getParcelOverlay();
LLImageGL *texturep = overlayp->getTexture();
glEnableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
LLViewerImage::bindTexture(texturep);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
// *NOTE: Because the region is 256 meters wide, but has 257 pixels, the
// texture coordinates for pixel 256x256 is not 1,1. This makes the
// ownership map not line up with the selection. We address this with
// a texture matrix multiply.
glMatrixMode(GL_TEXTURE);
glPushMatrix();
const F32 TEXTURE_FUDGE = 257.f / 256.f;
glScalef( TEXTURE_FUDGE, TEXTURE_FUDGE, 1.f );
for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
iter != mDrawFace.end(); iter++)
{
LLFace *facep = *iter;
facep->renderIndexed(LLVertexBuffer::MAP_VERTEX |
LLVertexBuffer::MAP_TEXCOORD);
}
glMatrixMode(GL_TEXTURE);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
// Restore non Texture Unit specific defaults
glDisableClientState(GL_NORMAL_ARRAY);
}