Update API documentation and remove obsolete plan files

This commit is contained in:
2026-03-21 15:55:04 +08:00
parent 7a6cd412c8
commit 629455df07
75 changed files with 1075 additions and 1816 deletions

View File

@@ -0,0 +1,44 @@
# OpenGLShader::SetMat4Array
设置 4x4 矩阵数组 uniform 变量。
```cpp
void SetMat4Array(const char* name, const float* values, unsigned int count);
```
通过名称查找并设置着色器中的 4x4 矩阵数组 uniform 变量。矩阵按列主序存储。
**参数:**
- `name` - uniform 变量名称
- `values` - 指向 `count * 16` 个 float 元素的数组指针(列主序排列)
- `count` - 矩阵数量
**返回:**
**线程安全:** ❌(需要在渲染线程调用)
**示例:**
```cpp
// 设置多个变换矩阵(例如骨骼动画)
const unsigned int boneCount = 4;
float boneMatrices[4 * 16] = {
// 第一个矩阵
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
// 第二个矩阵
0.5f, 0.0f, 0.0f, 0.0f,
0.0f, 0.5f, 0.0f, 0.0f,
0.0f, 0.0f, 0.5f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
// ...更多矩阵
};
shader->SetMat4Array("u_boneMatrices", boneMatrices, boneCount);
```
## 相关文档
- [OpenGLShader 总览](shader.md) - 返回类总览
- [SetMat4 (single)](../../shader/set-mat4.md) - 设置单个 4x4 矩阵