docs: update math API docs
This commit is contained in:
35
docs/api/math/matrix4/operator_index.md
Normal file
35
docs/api/math/matrix4/operator_index.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Matrix4x4::operator[]
|
||||
|
||||
```cpp
|
||||
float* operator[](int row)
|
||||
const float* operator[](int row) const
|
||||
```
|
||||
|
||||
通过行索引访问矩阵元素。返回指向该行第一列元素的指针。
|
||||
|
||||
**参数:**
|
||||
- `row` - 行索引(0-3)
|
||||
|
||||
**返回:** 指向该行数据的指针
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include "XCEngine/Math/Matrix4.h"
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
Matrix4 m = Matrix4::Identity();
|
||||
m[0][0] = 5.0f; // 设置第一行第一列
|
||||
m[1][2] = 3.0f; // 设置第二行第三列
|
||||
|
||||
float val = m[0][1]; // 读取第一行第二列
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Matrix4](matrix4.md) - 返回类总览
|
||||
Reference in New Issue
Block a user