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

44
docs/api/math/box/box.md Normal file
View File

@@ -0,0 +1,44 @@
# Box
带变换的包围盒结构体(支持 OBB 语义,取决于方法)。
**头文件:** `#include <XCEngine/Math/Box.h>`
**命名空间:** `XCEngine::Math`
## 结构体定义
```cpp
struct Box {
Vector3 center = Vector3::Zero();
Vector3 extents = Vector3::Zero();
Matrix4x4 transform = Matrix4x4::Identity();
};
```
**成员:**
- `center` - 包围盒中心点
- `extents` - 包围盒半长(各轴向的半径)
- `transform` - 变换矩阵(用于 OBB 检测)
**注意:** `Contains` 方法会使用 `transform` 进行真正的 OBB 检测。`Intersects(Box)` 目前使用 AABB 简化算法,未考虑旋转。
## 构造函数
- `Box()` - 默认构造
- `Box(const Vector3& center, const Vector3& extents)` - 从中心和半长构造
## 实例方法
| 方法 | 返回值 | 描述 |
|------|--------|------|
| [GetMin()](getmin.md) | `Vector3` | 局部空间最小点 |
| [GetMax()](getmax.md) | `Vector3` | 局部空间最大点 |
| [Contains(point)](contains.md) | `bool` | 点是否在盒内(使用 transform |
| [Intersects(Sphere)](intersects.md) | `bool` | 与球体相交 |
| [Intersects(Box)](intersects-box.md) | `bool` | 与另一个盒相交AABB 检测) |
| [Intersects(Ray, t)](intersects-ray.md) | `bool` | 与射线相交 |
## 相关文档
- [Math 模块总览](../math.md) - 返回 Math 模块总览

View File

@@ -0,0 +1,20 @@
# Box::Contains
```cpp
bool Contains(const Vector3& point) const
```
检测点是否在盒内。
**参数:**
- `point` - 要检测的点
**返回:** `bool` - true 表示点在盒内
**复杂度:** O(1)
**示例:**
```cpp
if (box.Contains(point)) { /* inside */ }
```

View File

@@ -0,0 +1,17 @@
# Box::GetMax
```cpp
Vector3 GetMax() const
```
获取局部空间最大点。
**返回:** `Vector3` - (+extents)
**复杂度:** O(1)
**示例:**
```cpp
Vector3 max = box.GetMax();
```

View File

@@ -0,0 +1,17 @@
# Box::GetMin
```cpp
Vector3 GetMin() const
```
获取局部空间最小点。
**返回:** `Vector3` - (-extents)
**复杂度:** O(1)
**示例:**
```cpp
Vector3 min = box.GetMin();
```

View File

@@ -0,0 +1,22 @@
# Box::Intersects (Box)
```cpp
bool Intersects(const Box& other) const
```
检测两个盒是否相交(使用 AABB 简化算法,暂未考虑 transform 旋转)。
**参数:**
- `other` - 另一个盒
**返回:** `bool` - true 表示相交
**注意:** 当前实现为 AABB 检测,未使用 transform 进行真正的 OBB-SAT 检测。
**复杂度:** O(1)
**示例:**
```cpp
if (box.Intersects(otherBox)) { /* collision */ }
```

View File

@@ -0,0 +1,24 @@
# Box::Intersects (Ray)
```cpp
bool Intersects(const Ray& ray, float& t) const
```
检测盒是否与射线相交。
**参数:**
- `ray` - 射线
- `t` - 输出交点距离
**返回:** `bool` - true 表示相交
**复杂度:** O(1)
**示例:**
```cpp
float t;
if (box.Intersects(ray, t)) {
Vector3 hit = ray.GetPoint(t);
}
```

View File

@@ -0,0 +1,20 @@
# Box::Intersects
```cpp
bool Intersects(const Sphere& sphere) const
```
检测盒是否与球体相交。
**参数:**
- `sphere` - 球体
**返回:** `bool` - true 表示相交
**复杂度:** O(1)
**示例:**
```cpp
if (box.Intersects(sphere)) { /* collision */ }
```