本文整理汇总了C++中osg::Geometry::setSecondaryColorArray方法的典型用法代码示例。如果您正苦于以下问题:C++ Geometry::setSecondaryColorArray方法的具体用法?C++ Geometry::setSecondaryColorArray怎么用?C++ Geometry::setSecondaryColorArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Geometry
的用法示例。
在下文中一共展示了Geometry::setSecondaryColorArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void apply(osg::Geometry& geom)
{
geom.setUseDisplayList(false);
if (!_manualVertexAliasing) return;
osg::notify(osg::NOTICE)<<"Found geometry "<<&geom<<std::endl;
if (geom.getVertexArray())
{
setVertexAttrib(geom, _vertexAlias, geom.getVertexArray(), false, osg::Array::BIND_PER_VERTEX);
geom.setVertexArray(0);
}
if (geom.getNormalArray())
{
setVertexAttrib(geom, _normalAlias, geom.getNormalArray(), true);
geom.setNormalArray(0);
}
if (geom.getColorArray())
{
setVertexAttrib(geom, _colorAlias, geom.getColorArray(), false);
geom.setColorArray(0);
}
if (geom.getSecondaryColorArray())
{
setVertexAttrib(geom, _secondaryColorAlias, geom.getSecondaryColorArray(), false);
geom.setSecondaryColorArray(0);
}
if (geom.getFogCoordArray())
{
// should we normalize the FogCoord array? Don't think so...
setVertexAttrib(geom, _fogCoordAlias, geom.getFogCoordArray(), false);
geom.setFogCoordArray(0);
}
unsigned int maxNumTexCoords = geom.getNumTexCoordArrays();
if (maxNumTexCoords>8)
{
osg::notify(osg::NOTICE)<<"Warning: Ignoring "<<maxNumTexCoords-8<<" texture coordinate arrays, only 8 are currently supported in vertex attribute conversion code."<<std::endl;
maxNumTexCoords = 8;
}
for(unsigned int i=0; i<maxNumTexCoords; ++i)
{
if (geom.getTexCoordArray(i))
{
setVertexAttrib(geom, _texCoordAlias[i], geom.getTexCoordArray(i), false, osg::Array::BIND_PER_VERTEX);
geom.setTexCoordArray(i,0);
}
else
{
osg::notify(osg::NOTICE)<<"Found empty TexCoordArray("<<i<<")"<<std::endl;
}
}
}