Files
XCEngine/docs/api/resources/mesh/get-sections.md

709 B

Mesh::GetSections

const Containers::Array<MeshSection>& GetSections() const;

获取网格的所有分段信息。

参数:

返回: const Containers::Array<MeshSection>& - 分段数组的只读引用

异常:

线程安全:

复杂度: O(1)

示例:

#include "XCEngine/Resources/Mesh.h"

using namespace XCEngine::Resources;

Mesh mesh;
mesh.SetVertexData(...);
mesh.SetIndexData(...);
mesh.AddSection(...);

const auto& sections = mesh.GetSections();
for (size_t i = 0; i < sections.Size(); ++i) {
    const MeshSection& section = sections[i];
    // 处理每个分段
}

相关文档