docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录 - 重命名 index.md 为 main.md - 修正所有模块文档中的错误: - math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式 - containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节 - core: 修复 types 链接错误 - debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI - memory: 修复头文件路径, malloc vs operator new, 新增方法文档 - resources: 修复 Shader/Texture 链接错误 - threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接 - 验证: fix_links.py 确认 0 个断裂引用
This commit is contained in:
17
docs/api/math/transform/inverse.md
Normal file
17
docs/api/math/transform/inverse.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Transform::Inverse
|
||||
|
||||
```cpp
|
||||
Transform Inverse() const
|
||||
```
|
||||
|
||||
返回变换的逆。
|
||||
|
||||
**返回:** `Transform` - 逆变换
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Transform inv = transform.Inverse();
|
||||
```
|
||||
21
docs/api/math/transform/inversetransformdirection.md
Normal file
21
docs/api/math/transform/inversetransformdirection.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Transform::InverseTransformDirection
|
||||
|
||||
```cpp
|
||||
Vector3 InverseTransformDirection(const Vector3& direction) const
|
||||
```
|
||||
|
||||
对方向进行逆变换(包含缩放处理)。
|
||||
|
||||
**参数:**
|
||||
- `direction` - 世界空间中的方向
|
||||
|
||||
**返回:** `Vector3` - 局部空间中的方向
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Transform t;
|
||||
Vector3 localDir = t.InverseTransformDirection(worldDir);
|
||||
```
|
||||
21
docs/api/math/transform/inversetransformpoint.md
Normal file
21
docs/api/math/transform/inversetransformpoint.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Transform::InverseTransformPoint
|
||||
|
||||
```cpp
|
||||
Vector3 InverseTransformPoint(const Vector3& point) const
|
||||
```
|
||||
|
||||
对点进行逆变换。
|
||||
|
||||
**参数:**
|
||||
- `point` - 世界空间中的点
|
||||
|
||||
**返回:** `Vector3` - 局部空间中的点
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Transform t;
|
||||
Vector3 localPos = t.InverseTransformPoint(worldPos);
|
||||
```
|
||||
19
docs/api/math/transform/tomatrix.md
Normal file
19
docs/api/math/transform/tomatrix.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Transform::ToMatrix
|
||||
|
||||
```cpp
|
||||
Matrix4 ToMatrix() const
|
||||
```
|
||||
|
||||
将变换转换为 4x4 变换矩阵。
|
||||
|
||||
**返回:** `Matrix4` - TRS 变换矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Transform t;
|
||||
t.position = Vector3(1.0f, 2.0f, 3.0f);
|
||||
Matrix4 matrix = t.ToMatrix();
|
||||
```
|
||||
44
docs/api/math/transform/transform.md
Normal file
44
docs/api/math/transform/transform.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Transform
|
||||
|
||||
3D 变换结构体,包含位置、旋转和缩放,用于层次化变换。
|
||||
|
||||
**头文件:** `#include <XCEngine/Math/Transform.h>`
|
||||
|
||||
**命名空间:** `XCEngine::Math`
|
||||
|
||||
## Space 枚举
|
||||
|
||||
```cpp
|
||||
enum class Space { Self, World };
|
||||
```
|
||||
|
||||
## 结构体定义
|
||||
|
||||
```cpp
|
||||
struct Transform {
|
||||
Vector3 position = Vector3::Zero();
|
||||
Quaternion rotation = Quaternion::Identity();
|
||||
Vector3 scale = Vector3::One();
|
||||
};
|
||||
```
|
||||
|
||||
## 实例方法
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| [ToMatrix()](tomatrix.md) | `Matrix4` | 转换为 4x4 变换矩阵 |
|
||||
| [Inverse()](inverse.md) | `Transform` | 逆变换 |
|
||||
| `operator*(Transform, Transform)` | `Transform` | 组合变换 |
|
||||
|
||||
### 空间变换
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| [TransformPoint(point)](transformpoint.md) | `Vector3` | 变换点(带平移) |
|
||||
| [TransformDirection(direction)](transformdirection.md) | `Vector3` | 变换方向(包含旋转和缩放) |
|
||||
| [InverseTransformPoint(point)](inversetransformpoint.md) | `Vector3` | 逆变换点 |
|
||||
| [InverseTransformDirection(direction)](inversetransformdirection.md) | `Vector3` | 逆变换方向 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Math 模块总览](../math.md) - 返回 Math 模块总览
|
||||
22
docs/api/math/transform/transformdirection.md
Normal file
22
docs/api/math/transform/transformdirection.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Transform::TransformDirection
|
||||
|
||||
```cpp
|
||||
Vector3 TransformDirection(const Vector3& direction) const
|
||||
```
|
||||
|
||||
变换方向(仅旋转,包含缩放)。
|
||||
|
||||
**参数:**
|
||||
- `direction` - 要变换的方向
|
||||
|
||||
**返回:** `Vector3` - 变换后的方向
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Transform t;
|
||||
Vector3 localDir(1.0f, 0.0f, 0.0f);
|
||||
Vector3 worldDir = t.TransformDirection(localDir);
|
||||
```
|
||||
22
docs/api/math/transform/transformpoint.md
Normal file
22
docs/api/math/transform/transformpoint.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Transform::TransformPoint
|
||||
|
||||
```cpp
|
||||
Vector3 TransformPoint(const Vector3& point) const
|
||||
```
|
||||
|
||||
变换点(包含位置、旋转和缩放)。
|
||||
|
||||
**参数:**
|
||||
- `point` - 要变换的点
|
||||
|
||||
**返回:** `Vector3` - 变换后的点
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Transform t;
|
||||
Vector3 localPos(1.0f, 0.0f, 0.0f);
|
||||
Vector3 worldPos = t.TransformPoint(localPos);
|
||||
```
|
||||
Reference in New Issue
Block a user