本文整理汇总了C++中GeometryPtr::getMaterial方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryPtr::getMaterial方法的具体用法?C++ GeometryPtr::getMaterial怎么用?C++ GeometryPtr::getMaterial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryPtr
的用法示例。
在下文中一共展示了GeometryPtr::getMaterial方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enter
Action::ResultE OOCOSGFeeder::enter(NodePtr& node)
{
GeometryPtr geo = GeometryPtr::dcast(node->getCore());
if(geo == NullFC)
return Action::Continue;
GeoPositionsPtr pos = geo->getPositions();
UInt32 pntindexbase;
if(_poss.find(pos) != _poss.end())
{
pntindexbase = _poss[pos];
pos = NullFC;
}
else
{
pntindexbase = _pntindexbase;
_poss[pos] = _pntindexbase;
_pntindexbase += pos->getSize();
}
UInt32 matind = MaterialPool::addMaterial(geo->getMaterial());
if(pos != NullFC)
{
if(_pfunc != NULL)
{
Pnt3f p;
UInt32 s = pos->getSize();
for(UInt32 i = 0; i < s; ++i)
{
if(_npts != 0)
{
++_pntprog;
Real32 prog = _pntprog / (Real32)_npts;
if(prog > _nextpntprog)
{
PLOG << _nextpntprog * 100 << "%..";
_nextpntprog += 0.1;
}
}
pos->getValue(p, i);
_pfunc(_rec, p);
}
}
}
if(_tfunc != NULL)
{
TriangleIterator it, end = geo->endTriangles();
for(it = geo->beginTriangles();
it != end;
++it)
{
if(_ntris != 0)
{
++_triprog;
Real32 prog = _triprog / (Real32)_ntris;
if(prog > _nexttriprog)
{
PLOG << _nexttriprog * 100 << "%..";
_nexttriprog += 0.1;
}
}
_tfunc(_rec, it.getPositionIndex(0) + pntindexbase,
it.getPositionIndex(1) + pntindexbase,
it.getPositionIndex(2) + pntindexbase,
matind);
}
}
return Action::Continue;
}