本文整理汇总了C++中MeshBuilder::vertices方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshBuilder::vertices方法的具体用法?C++ MeshBuilder::vertices怎么用?C++ MeshBuilder::vertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshBuilder
的用法示例。
在下文中一共展示了MeshBuilder::vertices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool MeshBuilder::operator==( const MeshBuilder& other ) const
{
if ( vertices() != other.vertices() )
return false;
if ( polygons() != other.polygons() )
return false;
if ( vertexMaps() != other.vertexMaps() )
return false;
if ( discontinuousVertexMaps() != other.discontinuousVertexMaps() )
return false;
for ( int i = 0 ; i < m_this->vertices.size() ; ++i )
if ( *m_this->vertices[i] != *other.m_this->vertices[i] )
return false;
for ( int i = 0 ; i < m_this->polygons.size() ; ++i )
if ( *m_this->polygons[i] != *other.m_this->polygons[i] )
return false;
for ( int i = 0 ; i < m_this->vertexMaps.size() ; ++i )
if ( *m_this->vertexMaps[i] != *other.m_this->vertexMaps[i] )
return false;
for ( int i = 0 ; i < m_this->discontinuousVertexMaps.size() ; ++i )
if ( *m_this->discontinuousVertexMaps[i] != *other.m_this->discontinuousVertexMaps[i] )
return false;
return true;
}
示例2: test
static int test()
{
MeshBuilder mesh;
Vertex* v[4];
int i;
for ( i = 0 ; i < 4 ; ++i ) // 0 1
v[i] = mesh.addVertex(); // 3 2
Polygon* a = mesh.addPolygon();
a->addVertex( v[0] );
a->addVertex( v[1] );
a->addVertex( v[2] );
Polygon* b = mesh.addPolygon();
b->addVertex( v[0] );
b->addVertex( v[2] );
b->addVertex( v[3] );
VertexMap* vmap = mesh.addVertexMap( 2, "TXUV", VertexMapFormat::VERTEXMAP_TEXCOORD );
float uv[4][2] = { {0, 0}, {1,0}, {1,1}, {0,1} };
vmap->addValue( v[2]->index(), uv[2], 2 );
vmap->addValue( v[1]->index(), uv[1], 2 );
vmap->addValue( v[3]->index(), uv[3], 2 );
vmap->addValue( v[0]->index(), uv[0], 2 );
v[1] = a->getVertex(1)->clone();
a->setVertex( 1, v[1] );
assert( mesh.vertices() == 5 );
float uv1[4][2];
memset( uv1, 0, sizeof(uv1) );
for ( i = 0 ; i < 4 ; ++i )
{
vmap->getValue( v[i]->index(), uv1[i], 2 );
assert( !memcmp(uv[i],uv1[i],sizeof(uv[i])) );
}
assert( vmap->dimensions() == 2 );
assert( vmap->name() == "TXUV" );
return 0;
}