本文整理汇总了C++中CObj::GetID方法的典型用法代码示例。如果您正苦于以下问题:C++ CObj::GetID方法的具体用法?C++ CObj::GetID怎么用?C++ CObj::GetID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CObj
的用法示例。
在下文中一共展示了CObj::GetID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawScene
void CRenderer::DrawScene(const CFrustum& frustum,
CWorld* world,
int localctrlid,
bool generateShadowMap)
{
CObj* obj;
OBJITER iter;
// Draw the level
if(!generateShadowMap && world->GetBSP()->IsLoaded())
{
// Draw the level with lightmapping?
if(m_lightmapactive && m_shaderactive)
glUniform1i(m_uselightmap, 1);
world->GetBSP()->RenderGL(frustum.pos, frustum);
if(m_shaderactive)
glUniform1i(m_uselightmap, 0);
}
// Draw every object
for(iter=world->ObjBegin();iter!=world->ObjEnd();++iter)
{
obj = (*iter).second;
if((obj->GetFlags() & OBJ_FLAGS_GHOST) || // ghosts are invisible - duh
obj->GetID() == localctrlid || // don't draw the player object
!obj->GetMesh()) // object has no md5 model
continue;
// check if object is in view frustum
if(!generateShadowMap && !frustum.TestSphere(obj->GetOrigin(), obj->GetRadius()))
continue;
glPushMatrix();
glTranslatef(obj->GetOrigin().x, obj->GetOrigin().y, obj->GetOrigin().z);
glTranslatef(0.0f, -obj->GetRadius(), 0.0f);
glMultMatrixf(obj->GetRotMatrix()->pm);
obj->GetMesh()->Render(obj->GetMeshState());
#ifdef DRAW_NORMALS
obj->GetMesh()->RenderNormals(obj->GetMeshState()); // not implemented for md2s?
#endif
glPopMatrix();
}
}