Пример #1
0
GLuint GLODMesh::createGroupName()
{
    _lodGroupName  = s_lodGroup;
    glodNewGroup( _lodGroupName );
    ++s_lodGroup;

    return _lodGroupName;
}
Пример #2
0
void create_glod_object_from_vertex_buffers(S32 object, S32 group, std::vector<LLPointer <LLVertexBuffer> >& vertex_buffers)
{
	glodNewGroup(group);
	stop_gloderror();
	glodNewObject(object, group, GLOD_DISCRETE);
	stop_gloderror();

	for (U32 i = 0; i < vertex_buffers.size(); ++i)
	{
		vertex_buffers[i]->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
		
		U32 num_indices = vertex_buffers[i]->getNumIndices();
		
		if (num_indices > 2)
		{
			glodInsertElements(object, i, GL_TRIANGLES, num_indices, GL_UNSIGNED_SHORT,
							   vertex_buffers[i]->getIndicesPointer(), 0, 0.f);
		}
		stop_gloderror();
	}
	
	glodBuildObject(object);
	stop_gloderror();
}