本文整理汇总了C++中AutoArray::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoArray::Count方法的具体用法?C++ AutoArray::Count怎么用?C++ AutoArray::Count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutoArray
的用法示例。
在下文中一共展示了AutoArray::Count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: index_VBO
static void index_VBO(
const vector<vec4> & in_vertices,
const vector<vec2> & in_uvs,
const vector<vec3> & in_normals,
AutoArray<unsigned short> & out_indices,
AutoArray<vec4> & out_vertices,
AutoArray<vec2> & out_uvs,
AutoArray<vec3> & out_normals
)
{
map<PackedVertex,unsigned short> VertexToOutIndex;
// For each input vertex
unsigned int numVertices = in_vertices.size();
for (unsigned int i = 0; i < numVertices; i++)
{
PackedVertex packed;
packed.position = in_vertices[i];
packed.uv = in_uvs[i];
packed.normal = in_normals[i];
// Try to find a similar vertex in out_XXXX
unsigned short index;
bool found = get_similar_vertex_index(packed, VertexToOutIndex, index);
if(found)
{
// A similar vertex is already in the VBO, use it instead !
out_indices.Push(index);
}
else
{
out_vertices.Push(in_vertices[i]);
out_uvs.Push(in_uvs[i]);
out_normals.Push(in_normals[i]);
unsigned short newindex = (unsigned short) out_vertices.Count() - 1;
out_indices.Push(newindex);
VertexToOutIndex[packed] = newindex;
}
}
}