本文整理汇总了C++中CBlock::isFaceVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlock::isFaceVisible方法的具体用法?C++ CBlock::isFaceVisible怎么用?C++ CBlock::isFaceVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlock
的用法示例。
在下文中一共展示了CBlock::isFaceVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//.........这里部分代码省略.........
glRotatef(-bObj->getRotateY(),0.0f,1.0f,0.0f);
bObj->moveBack();
}
}
bool isRoom = block->isRoom();
if (isRoom)
{
std::vector<GLuint> *dls = block->getDisplayLists();
if (dls->size()!=0)
{
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,textureAtlasColor);
glBegin(GL_QUADS);
{
for (std::vector<GLuint>::iterator dlIter = dls->begin(); dlIter != dls->end(); dlIter++)
{
glCallList(*dlIter);
}
}
glEnd();
glDisable(GL_TEXTURE_2D);
}
}
for (GLint f=CBlock::BFS_FRONT; f<=CBlock::BFS_CEILING; f++)
{
if ((!isFPS && f==CBlock::BFS_CEILING) || (isFPS && f==CBlock::BFS_TOP) || (isRoom && f!=CBlock::BFS_CEILING))
{
continue;
}
if (block->isFaceVisible((CBlock::BLOCK_FACE_SELECTOR)f))
{
verts = block->getVertices();
texCoords = block->getTextureCoordinates((CBlock::BLOCK_FACE_SELECTOR)f);
if (lavaWater && f<=CBlock::BFS_RIGHT)
{
/*
Lava and water have only lowers row of wall sections drawn.
If they are drawn at all.
*/
maxVertInput = CV_FBLR_W_L_FACE_VERT_FLOATS;
maxTexInput = CV_FBLR_W_L_FACE_TEX_FLOATS;
}
else
{
maxVertInput = f>=CBlock::BFS_TOP?CV_TBWLC_FACE_VERT_FLOATS:CV_FBLR_FACE_VERT_FLOATS;
maxTexInput = f>=CBlock::BFS_TOP?CV_TBWLC_FACE_TEX_FLOATS:CV_FBLR_FACE_TEX_FLOATS;
}
if (tmpVboVertexBufferSize+maxVertInput>CV_MAX_VERTEX_BUFFER*3)
{
vbo->setElementsCount(CVBO::IDT_vertex,tmpVboVertexBufferSize/3);
vbo->setElementsCount(CVBO::IDT_texture0,tmpVboTexCoordBufferSize/2);
vbo->setElementsCount(CVBO::IDT_texture1,tmpVboTexCoordBufferSize/2);
vbo->draw();
allVerticesCount+=tmpVboVertexBufferSize;
tmpVboVertexBufferSize=0;
tmpVboTexCoordBufferSize=0;
}
memcpy(tmpVboVertexBuffer+tmpVboVertexBufferSize, verts[f], sizeof(GLfloat)*maxVertInput);
tmpVboVertexBufferSize+=maxVertInput;