fix: improve doc link navigation and tree display

- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
This commit is contained in:
2026-03-19 12:44:08 +08:00
parent e003fe6513
commit 58a83f445a
1012 changed files with 56880 additions and 22 deletions

View File

@@ -0,0 +1,23 @@
# Vector4::Dot
```cpp
static float Dot(const Vector4& a, const Vector4& b)
```
计算两个 4D 向量的点积。
**参数:**
- `a` - 第一个向量
- `b` - 第二个向量
**返回:** `float` - 点积结果
**复杂度:** O(1)
**示例:**
```cpp
Vector4 a(1.0f, 2.0f, 3.0f, 4.0f);
Vector4 b(4.0f, 3.0f, 2.0f, 1.0f);
float dot = Vector4::Dot(a, b); // 20.0f
```

View File

@@ -0,0 +1,17 @@
# Vector4::One
```cpp
static Vector4 One()
```
返回单位向量 (1, 1, 1, 1)。
**返回:** `Vector4` - 值为 (1, 1, 1, 1) 的向量
**复杂度:** O(1)
**示例:**
```cpp
Vector4 unit = Vector4::One();
```

View File

@@ -0,0 +1,23 @@
# Vector4::Project
```cpp
static Vector4 Project(const Vector4& vector, const Vector4& onNormal)
```
将向量投影到法线向量上。
**参数:**
- `vector` - 要投影的向量
- `onNormal` - 投影到的法线向量
**返回:** `Vector4` - 投影结果
**复杂度:** O(1)
**示例:**
```cpp
Vector4 v(1.0f, 1.0f, 1.0f, 1.0f);
Vector4 normal(1.0f, 0.0f, 0.0f, 0.0f);
Vector4 projected = Vector4::Project(v, normal); // (1, 0, 0, 0)
```

View File

@@ -0,0 +1,18 @@
# Vector4::ToVector3
```cpp
Vector3 ToVector3() const
```
将 Vector4 转换为 Vector3丢弃 w 分量。
**返回:** `Vector3` - 转换后的 Vector3 (x, y, z)
**复杂度:** O(1)
**示例:**
```cpp
Vector4 pos4(1.0f, 2.0f, 3.0f, 1.0f);
Vector3 pos3 = pos4.ToVector3(); // (1, 2, 3)
```

View File

@@ -0,0 +1,53 @@
# Vector4
4D 向量结构体,用于表示齐次坐标、颜色 (RGBA) 或 SIMD 操作。
**头文件:** `#include <XCEngine/Math/Vector4.h>`
**命名空间:** `XCEngine::Math`
## 结构体定义
```cpp
struct Vector4 {
float x = 0.0f;
float y = 0.0f;
float z = 0.0f;
float w = 0.0f;
};
```
## 构造函数
- `Vector4(float x, float y, float z, float w)` - 从四个分量构造
- `explicit Vector4(const Vector3& v, float w = 0.0f)` - 从 Vector3 构造
## 静态工厂方法
| 方法 | 返回值 | 描述 |
|------|--------|------|
| [Zero()](zero.md) | `Vector4` | 返回 (0, 0, 0, 0) |
| [One()](one.md) | `Vector4` | 返回 (1, 1, 1, 1) |
## 静态数学方法
| 方法 | 返回值 | 描述 |
|------|--------|------|
| [Dot(a, b)](dot.md) | `float` | 4D 点积 |
| [Project(vector, onNormal)](project.md) | `Vector4` | 投影 |
## 实例方法
| 方法 | 返回值 | 描述 |
|------|--------|------|
| [ToVector3()](tovector3.md) | `Vector3` | 转换到 Vector3丢弃 w |
## 运算符
- 算术: `+`, `-`, `*` (scalar)
- 下标: `operator[]` (0=x, 1=y, 2=z, 3=w)
- 比较: `==`, `!=`
## 相关文档
- [Math 模块总览](../math.md) - 返回 Math 模块总览

View File

@@ -0,0 +1,17 @@
# Vector4::Zero
```cpp
static Vector4 Zero()
```
返回零向量 (0, 0, 0, 0)。
**返回:** `Vector4` - 值为 (0, 0, 0, 0) 的向量
**复杂度:** O(1)
**示例:**
```cpp
Vector4 origin = Vector4::Zero();
```