docs: update resources API docs
This commit is contained in:
40
docs/api/resources/mesh/get-sections.md
Normal file
40
docs/api/resources/mesh/get-sections.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Mesh::GetSections
|
||||
|
||||
```cpp
|
||||
const Containers::Array<MeshSection>& GetSections() const;
|
||||
```
|
||||
|
||||
获取网格的所有分段信息。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** `const Containers::Array<MeshSection>&` - 分段数组的只读引用
|
||||
|
||||
**异常:** 无
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#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];
|
||||
// 处理每个分段
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [类总览](mesh.md) - 返回类总览
|
||||
Reference in New Issue
Block a user