本文整理汇总了C++中IRenderAuxGeom::DrawTriangles方法的典型用法代码示例。如果您正苦于以下问题:C++ IRenderAuxGeom::DrawTriangles方法的具体用法?C++ IRenderAuxGeom::DrawTriangles怎么用?C++ IRenderAuxGeom::DrawTriangles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRenderAuxGeom
的用法示例。
在下文中一共展示了IRenderAuxGeom::DrawTriangles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
//.........这里部分代码省略.........
pAux->DrawCone( iterList->pos + iterList->dir * iterList->radius, iterList->dir, 0.1f * iterList->radius, 0.3f * iterList->radius, clr );
break;
case eOT_Line:
pAux->SetRenderFlags( flags3D );
pAux->DrawLine( iterList->pos, clr, iterList->pos + iterList->dir, clr );
break;
case eOT_Cone:
pAux->SetRenderFlags( flags3D );
pAux->DrawCone( iterList->pos, iterList->dir, iterList->radius, iterList->radius2, clr );
break;
case eOT_Cylinder:
pAux->SetRenderFlags( flags3D );
pAux->DrawCylinder( iterList->pos, iterList->dir, iterList->radius, iterList->radius2, clr );
break;
case eOT_AABB:
pAux->SetRenderFlags( flags3D );
pAux->DrawAABB( AABB(iterList->pos,iterList->dir), Matrix34(IDENTITY), false, clr, eBBD_Faceted );
break;
case eOT_Line2D:
pAux->SetRenderFlags( flags2D );
pAux->DrawLine( iterList->pos, clr, iterList->dir, clr );
break;
case eOT_Text:
{
float clrAry[4] = {clr.r, clr.g, clr.b, clr.a};
gEnv->pRenderer->Draw2dLabel( iterList->pos.x, iterList->pos.y, iterList->radius, clrAry, false, "%s", iterList->text.c_str() );
}
break;
case eOT_Disc:
{
pAux->SetRenderFlags( flags3D );
vtx_idx indTriQuad[ 6 ] =
{
0, 2, 1,
0, 3, 2
};
vtx_idx indTriTri[ 3 ] =
{
0, 1, 2
};
int steps = (int)(10 * iterList->radius2);
steps = std::max(steps, 10);
float angStep = gf_PI2 / steps;
for (int i=0; i<steps; i++)
{
float a0 = angStep*i;
float a1 = angStep*(i+1);
float c0 = cosf( a0 );
float c1 = cosf( a1 );
float s0 = sinf( a0 );
float s1 = sinf( a1 );
Vec3 pts[4];
int n, n2;
vtx_idx * indTri;
if (iterList->radius)
{
n = 4;
n2 = 6;
pts[0] = iterList->pos + iterList->radius * Vec3( c0, s0, 0 );
pts[1] = iterList->pos + iterList->radius * Vec3( c1, s1, 0 );
pts[2] = iterList->pos + iterList->radius2 * Vec3( c1, s1, 0 );
pts[3] = iterList->pos + iterList->radius2 * Vec3( c0, s0, 0 );
indTri = indTriQuad;
}
else
{
n = 3;
n2 = 3;
pts[0] = iterList->pos;
pts[1] = pts[0] + iterList->radius2 * Vec3( c0, s0, 0 );
pts[2] = pts[0] + iterList->radius2 * Vec3( c1, s1, 0 );
indTri = indTriTri;
}
pAux->DrawTriangles( pts, n, indTri, n2, clr );
}
}
break;
case eOT_EntityTag:
{
UpdateTags(frameTime, *iterList);
}
break;
}
}
}
while (!toClear.empty())
{
iterMap->second.erase(toClear.back());
toClear.pop_back();
}
if (iterMap->second.empty())
toClearMap.push_back(iterMap);
}
while (!toClearMap.empty())
{
m_objects.erase(toClearMap.back());
toClearMap.pop_back();
}
}