本文整理汇总了C++中GeometryPtr::getIndexMapping方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryPtr::getIndexMapping方法的具体用法?C++ GeometryPtr::getIndexMapping怎么用?C++ GeometryPtr::getIndexMapping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryPtr
的用法示例。
在下文中一共展示了GeometryPtr::getIndexMapping方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createGeo
GeometryPtr createGeo(UInt32 mat)
{
GeoIndicesPtr ind = _ind[mat];
FDEBUG(("CreateGeoRec::createGeo: Mat %d: %d inds (%d tris)\n",
mat, ind->getSize(), ind->getSize()/3));
endEditCP(ind);
GeometryPtr geo = Geometry::create();
GeoPLengthsUI32Ptr len = GeoPLengthsUI32::create();
beginEditCP(len);
len->push_back(ind->getSize());
endEditCP(len);
GeoPTypesUI8Ptr typ = GeoPTypesUI8::create();
beginEditCP(typ);
typ->push_back(GL_TRIANGLES);
endEditCP(typ);
beginEditCP(geo);
if(random_color)
{
SimpleMaterialPtr mat = SimpleMaterial::create();
beginEditCP(mat);
Color3f c( drand48() * .7f + .3f,
drand48() * .7f + .3f,
drand48() * .7f + .3f);
mat->setDiffuse(c);
mat->setSpecular(Color3f(1.f,1.f,1.f));
mat->setShininess(10.f);
endEditCP(mat);
geo->setMaterial(mat);
}
else
{
geo->setMaterial(MaterialPool::getMaterial(mat));
}
geo->setPositions(_pos);
geo->setIndices(ind);
geo->setLengths(len);
geo->setTypes(typ);
geo->getIndexMapping().push_back(Geometry::MapPosition);
endEditCP(geo);
calcVertexNormals(geo);
//calcFaceNormals(geo);
createSingleIndex(geo);
return geo;
}