本文整理汇总了C++中LLVertexBuffer::getNumIndices方法的典型用法代码示例。如果您正苦于以下问题:C++ LLVertexBuffer::getNumIndices方法的具体用法?C++ LLVertexBuffer::getNumIndices怎么用?C++ LLVertexBuffer::getNumIndices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLVertexBuffer
的用法示例。
在下文中一共展示了LLVertexBuffer::getNumIndices方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void LLDrawPoolTree::render(S32 pass)
{
LLFastTimer t(LLPipeline::sShadowRender ? FTM_SHADOW_TREE : FTM_RENDER_TREES);
if (mDrawFace.empty())
{
return;
}
LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1);
LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
gGL.getTexUnit(sDiffTex)->bind(mTexturep);
for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
iter != mDrawFace.end(); iter++)
{
LLFace *face = *iter;
LLVertexBuffer* buff = face->getVertexBuffer();
if(buff)
{
buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0);
gPipeline.addTrianglesDrawn(buff->getNumIndices());
}
}
}
示例2: render
void LLDrawPoolTree::render(S32 pass)
{
LLFastTimer t(LLPipeline::sShadowRender ? FTM_SHADOW_TREE : FTM_RENDER_TREES);
if (mDrawFace.empty())
{
return;
}
LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1);
LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
static LLCachedControl<bool> sRenderAnimateTrees("RenderAnimateTrees", false);
if (sRenderAnimateTrees)
{
renderTree();
}
else
gGL.getTexUnit(sDiffTex)->bind(mTexturep);
for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
iter != mDrawFace.end(); iter++)
{
LLFace *face = *iter;
LLVertexBuffer* buff = face->getVertexBuffer();
if(buff)
{
LLMatrix4* model_matrix = &(face->getDrawable()->getRegion()->mRenderMatrix);
if (model_matrix != gGLLastMatrix)
{
gGLLastMatrix = model_matrix;
gGL.loadMatrix(gGLModelView);
if (model_matrix)
{
llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
gGL.multMatrix((GLfloat*) model_matrix->mMatrix);
}
gPipeline.mMatrixOpCount++;
}
buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0);
gPipeline.addTrianglesDrawn(buff->getNumIndices());
}
}
}
示例3:
Wavefront::Wavefront(LLFace* face, LLPolyMesh* mesh, const LLXform* transform, const LLXform* transform_normals)
: name("")
{
LLVertexBuffer* vb = face->getVertexBuffer();
if (!vb) return;
LLStrider<LLVector3> getVerts;
LLStrider<LLVector3> getNorms;
LLStrider<LLVector2> getCoord;
LLStrider<U16> getIndices;
face->getGeometry(getVerts, getNorms, getCoord, getIndices);
const U16 start = face->getGeomStart();
const U32 end = start + (mesh ? mesh->getNumVertices() : vb->getNumVerts()) - 1; //vertices
for (U32 i = start; i <= end; ++i)
vertices.push_back(std::make_pair(getVerts[i], getCoord[i]));
if (transform) Transform(vertices, transform);
for (U32 i = start; i <= end; ++i)
normals.push_back(getNorms[i]);
if (transform_normals) Transform(normals, transform_normals);
const U32 pcount = mesh ? mesh->getNumFaces() : (vb->getNumIndices()/3); //indices
const U16 offset = face->getIndicesStart(); //indices
for (U32 i = 0; i < pcount; ++i)
{
triangles.push_back(tri(getIndices[i * 3 + offset] + start, getIndices[i * 3 + 1 + offset] + start, getIndices[i * 3 + 2 + offset] + start));
}
}
示例4: render
void LLDrawPoolTree::render(S32 pass)
{
LLFastTimer t(LLPipeline::sShadowRender ? FTM_SHADOW_TREE : FTM_RENDER_TREES);
if (mDrawFace.empty())
{
return;
}
LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1);
LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
gGL.getTexUnit(sDiffTex)->bind(mTexturep);
for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
iter != mDrawFace.end(); iter++)
{
LLFace *face = *iter;
if(face->getViewerObject())
{
LLVOTree* pTree = dynamic_cast<LLVOTree*>(face->getViewerObject());
if(pTree && !pTree->mDrawList.empty() )
{
LLMatrix4a* model_matrix = &(face->getDrawable()->getRegion()->mRenderMatrix);
gGL.loadMatrix(gGLModelView);
gGL.multMatrix(*model_matrix);
gPipeline.mMatrixOpCount++;
for(std::vector<LLPointer<LLDrawInfo> >::iterator iter2 = pTree->mDrawList.begin();
iter2 != pTree->mDrawList.end(); iter2++)
{
LLDrawInfo& params = *iter2->get();
gGL.pushMatrix();
gGL.multMatrix(*params.mModelMatrix);
gPipeline.mMatrixOpCount++;
params.mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset);
gGL.popMatrix();
}
continue;
}
}
LLVertexBuffer* buff = face->getVertexBuffer();
if(buff)
{
LLMatrix4a* model_matrix = &(face->getDrawable()->getRegion()->mRenderMatrix);
if(model_matrix && model_matrix->isIdentity())
{
model_matrix = NULL;
}
if (model_matrix != gGLLastMatrix)
{
gGLLastMatrix = model_matrix;
gGL.loadMatrix(gGLModelView);
if (model_matrix)
{
llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
gGL.multMatrix(*model_matrix);
}
gPipeline.mMatrixOpCount++;
}
buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0);
gPipeline.addTrianglesDrawn(buff->getNumIndices());
}
}
}