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:
24
docs/api/math/matrix4/decompose.md
Normal file
24
docs/api/math/matrix4/decompose.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Matrix4::Decompose
|
||||
|
||||
```cpp
|
||||
void Decompose(Vector3& translation, Quaternion& rotation, Vector3& scale) const
|
||||
```
|
||||
|
||||
将矩阵分解为平移、旋转和缩放分量。
|
||||
|
||||
**参数:**
|
||||
- `translation` - 输出平移向量
|
||||
- `rotation` - 输出旋转四元数
|
||||
- `scale` - 输出缩放向量
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 m = ...;
|
||||
Vector3 translation;
|
||||
Quaternion rotation;
|
||||
Vector3 scale;
|
||||
m.Decompose(translation, rotation, scale);
|
||||
```
|
||||
18
docs/api/math/matrix4/determinant.md
Normal file
18
docs/api/math/matrix4/determinant.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Matrix4::Determinant
|
||||
|
||||
```cpp
|
||||
float Determinant() const
|
||||
```
|
||||
|
||||
计算矩阵的行列式。
|
||||
|
||||
**返回:** `float` - 行列式值
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 m = ...;
|
||||
float det = m.Determinant();
|
||||
```
|
||||
18
docs/api/math/matrix4/getrotation.md
Normal file
18
docs/api/math/matrix4/getrotation.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Matrix4::GetRotation
|
||||
|
||||
```cpp
|
||||
Quaternion GetRotation() const
|
||||
```
|
||||
|
||||
从矩阵中提取旋转分量。
|
||||
|
||||
**返回:** `Quaternion` - 旋转四元数
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 m = ...;
|
||||
Quaternion rotation = m.GetRotation();
|
||||
```
|
||||
18
docs/api/math/matrix4/getscale.md
Normal file
18
docs/api/math/matrix4/getscale.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Matrix4::GetScale
|
||||
|
||||
```cpp
|
||||
Vector3 GetScale() const
|
||||
```
|
||||
|
||||
从矩阵中提取缩放分量。
|
||||
|
||||
**返回:** `Vector3` - 缩放向量
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 m = ...;
|
||||
Vector3 scale = m.GetScale();
|
||||
```
|
||||
18
docs/api/math/matrix4/gettranslation.md
Normal file
18
docs/api/math/matrix4/gettranslation.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Matrix4::GetTranslation
|
||||
|
||||
```cpp
|
||||
Vector3 GetTranslation() const
|
||||
```
|
||||
|
||||
从矩阵中提取平移分量。
|
||||
|
||||
**返回:** `Vector3` - 平移向量
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 m = ...;
|
||||
Vector3 translation = m.GetTranslation();
|
||||
```
|
||||
17
docs/api/math/matrix4/identity.md
Normal file
17
docs/api/math/matrix4/identity.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Matrix4::Identity
|
||||
|
||||
```cpp
|
||||
static Matrix4 Identity()
|
||||
```
|
||||
|
||||
返回 4x4 单位矩阵。
|
||||
|
||||
**返回:** `Matrix4` - 单位矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 identity = Matrix4::Identity();
|
||||
```
|
||||
18
docs/api/math/matrix4/inverse.md
Normal file
18
docs/api/math/matrix4/inverse.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Matrix4::Inverse
|
||||
|
||||
```cpp
|
||||
Matrix4 Inverse() const
|
||||
```
|
||||
|
||||
返回矩阵的逆矩阵。
|
||||
|
||||
**返回:** `Matrix4` - 逆矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 m = ...;
|
||||
Matrix4 inv = m.Inverse();
|
||||
```
|
||||
22
docs/api/math/matrix4/lookat.md
Normal file
22
docs/api/math/matrix4/lookat.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Matrix4::LookAt
|
||||
|
||||
```cpp
|
||||
static Matrix4 LookAt(const Vector3& eye, const Vector3& target, const Vector3& up)
|
||||
```
|
||||
|
||||
创建视图矩阵(观察矩阵)。
|
||||
|
||||
**参数:**
|
||||
- `eye` - 相机位置
|
||||
- `target` - 观察目标点
|
||||
- `up` - 世界空间中的上方向
|
||||
|
||||
**返回:** `Matrix4` - 视图矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 view = Matrix4::LookAt(cameraPos, target, Vector3::Up());
|
||||
```
|
||||
79
docs/api/math/matrix4/matrix4.md
Normal file
79
docs/api/math/matrix4/matrix4.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# Matrix4 / Matrix4x4
|
||||
|
||||
4x4 矩阵结构体,用于表示完整的 3D 变换(平移、旋转、缩放)、视图和投影变换。
|
||||
|
||||
**头文件:** `#include <XCEngine/Math/Matrix4.h>`
|
||||
|
||||
**命名空间:** `XCEngine::Math`
|
||||
|
||||
## 类型别名
|
||||
|
||||
```cpp
|
||||
using Matrix4 = Matrix4x4;
|
||||
```
|
||||
|
||||
## 存储方式
|
||||
|
||||
行优先存储 (row-major):
|
||||
```
|
||||
m[0][0] m[0][1] m[0][2] m[0][3]
|
||||
m[1][0] m[1][1] m[1][2] m[1][3]
|
||||
m[2][0] m[2][1] m[2][2] m[2][3]
|
||||
m[3][0] m[3][1] m[3][2] m[3][3]
|
||||
```
|
||||
|
||||
## 静态工厂方法
|
||||
|
||||
### 基础变换
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| [Identity()](identity.md) | `Matrix4` | 单位矩阵 |
|
||||
| [Zero()](zero.md) | `Matrix4` | 零矩阵 |
|
||||
| [Translation(v)](translation.md) | `Matrix4` | 平移矩阵 |
|
||||
| [Scale(v)](scale.md) | `Matrix4` | 缩放矩阵 |
|
||||
| [Rotation(q)](rotation.md) | `Matrix4` | 旋转矩阵(四元数) |
|
||||
| [TRS(translation, rotation, scale)](trs.md) | `Matrix4` | 完整变换 |
|
||||
|
||||
### 旋转
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| [RotationX(radians)](rotationx.md) | `Matrix4` | X 轴旋转 |
|
||||
| [RotationY(radians)](rotationy.md) | `Matrix4` | Y 轴旋转 |
|
||||
| [RotationZ(radians)](rotationz.md) | `Matrix4` | Z 轴旋转 |
|
||||
|
||||
### 相机变换
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| [LookAt(eye, target, up)](lookat.md) | `Matrix4` | 视图矩阵 |
|
||||
| [Perspective(fov, aspect, near, far)](perspective.md) | `Matrix4` | 透视投影 |
|
||||
| [Orthographic(left, right, bottom, top, near, far)](orthographic.md) | `Matrix4` | 正交投影 |
|
||||
|
||||
## 实例方法
|
||||
|
||||
### 乘法
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| `operator*(Matrix4, Matrix4)` | `Matrix4` | 矩阵乘法 |
|
||||
| `operator*(Matrix4, Vector4)` | `Vector4` | 矩阵-向量乘法 |
|
||||
| [MultiplyPoint(v)](multiplypoint.md) | `Vector3` | 点变换(带平移) |
|
||||
| [MultiplyVector(v)](multiplyvector.md) | `Vector3` | 方向变换(不带平移) |
|
||||
|
||||
### 分解
|
||||
|
||||
| 方法 | 返回值 | 描述 |
|
||||
|------|--------|------|
|
||||
| [Transpose()](transpose.md) | `Matrix4` | 转置矩阵 |
|
||||
| [Inverse()](inverse.md) | `Matrix4` | 逆矩阵 |
|
||||
| [Determinant()](determinant.md) | `float` | 行列式 |
|
||||
| [GetTranslation()](gettranslation.md) | `Vector3` | 获取平移分量 |
|
||||
| [GetRotation()](getrotation.md) | `Quaternion` | 获取旋转分量 |
|
||||
| [GetScale()](getscale.md) | `Vector3` | 获取缩放分量 |
|
||||
| [Decompose(translation, rotation, scale)](decompose.md) | `void` | 分解所有分量 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Math 模块总览](../math.md) - 返回 Math 模块总览
|
||||
21
docs/api/math/matrix4/multiplypoint.md
Normal file
21
docs/api/math/matrix4/multiplypoint.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Matrix4::MultiplyPoint
|
||||
|
||||
```cpp
|
||||
Vector3 MultiplyPoint(const Vector3& v) const
|
||||
```
|
||||
|
||||
使用矩阵变换点(包含平移)。
|
||||
|
||||
**参数:**
|
||||
- `v` - 要变换的点
|
||||
|
||||
**返回:** `Vector3` - 变换后的点
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 model = Matrix4::TRS(pos, rot, scale);
|
||||
Vector3 worldPos = model.MultiplyPoint(localPos);
|
||||
```
|
||||
21
docs/api/math/matrix4/multiplyvector.md
Normal file
21
docs/api/math/matrix4/multiplyvector.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Matrix4::MultiplyVector
|
||||
|
||||
```cpp
|
||||
Vector3 MultiplyVector(const Vector3& v) const
|
||||
```
|
||||
|
||||
使用矩阵变换方向向量(不包含平移)。
|
||||
|
||||
**参数:**
|
||||
- `v` - 要变换的方向向量
|
||||
|
||||
**返回:** `Vector3` - 变换后的方向
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 model = Matrix4::TRS(pos, rot, scale);
|
||||
Vector3 worldDir = model.MultiplyVector(localDir);
|
||||
```
|
||||
25
docs/api/math/matrix4/orthographic.md
Normal file
25
docs/api/math/matrix4/orthographic.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Matrix4::Orthographic
|
||||
|
||||
```cpp
|
||||
static Matrix4 Orthographic(float left, float right, float bottom, float top, float near, float far)
|
||||
```
|
||||
|
||||
创建正交投影矩阵。
|
||||
|
||||
**参数:**
|
||||
- `left` - 左裁剪面
|
||||
- `right` - 右裁剪面
|
||||
- `bottom` - 下裁剪面
|
||||
- `top` - 上裁剪面
|
||||
- `near` - 近裁剪面距离
|
||||
- `far` - 远裁剪面距离
|
||||
|
||||
**返回:** `Matrix4` - 正交投影矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 ortho = Matrix4::Orthographic(-aspect, aspect, -1.0f, 1.0f, 0.1f, 100.0f);
|
||||
```
|
||||
23
docs/api/math/matrix4/perspective.md
Normal file
23
docs/api/math/matrix4/perspective.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Matrix4::Perspective
|
||||
|
||||
```cpp
|
||||
static Matrix4 Perspective(float fov, float aspect, float near, float far)
|
||||
```
|
||||
|
||||
创建透视投影矩阵。
|
||||
|
||||
**参数:**
|
||||
- `fov` - 垂直视野角度(弧度)
|
||||
- `aspect` - 宽高比
|
||||
- `near` - 近裁剪面距离
|
||||
- `far` - 远裁剪面距离
|
||||
|
||||
**返回:** `Matrix4` - 透视投影矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 proj = Matrix4::Perspective(45.0f * DEG_TO_RAD, aspect, 0.1f, 100.0f);
|
||||
```
|
||||
21
docs/api/math/matrix4/rotation.md
Normal file
21
docs/api/math/matrix4/rotation.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Matrix4::Rotation
|
||||
|
||||
```cpp
|
||||
static Matrix4 Rotation(const Quaternion& q)
|
||||
```
|
||||
|
||||
从四元数创建旋转矩阵。
|
||||
|
||||
**参数:**
|
||||
- `q` - 四元数
|
||||
|
||||
**返回:** `Matrix4` - 旋转矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Quaternion rot = Quaternion::FromEulerAngles(0.0f, 90.0f * DEG_TO_RAD, 0.0f);
|
||||
Matrix4 rotation = Matrix4::Rotation(rot);
|
||||
```
|
||||
20
docs/api/math/matrix4/rotationx.md
Normal file
20
docs/api/math/matrix4/rotationx.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Matrix4::RotationX
|
||||
|
||||
```cpp
|
||||
static Matrix4 RotationX(float radians)
|
||||
```
|
||||
|
||||
创建绕 X 轴旋转的矩阵。
|
||||
|
||||
**参数:**
|
||||
- `radians` - 旋转角度(弧度)
|
||||
|
||||
**返回:** `Matrix4` - 旋转矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 rotX = Matrix4::RotationX(Math::HALF_PI);
|
||||
```
|
||||
20
docs/api/math/matrix4/rotationy.md
Normal file
20
docs/api/math/matrix4/rotationy.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Matrix4::RotationY
|
||||
|
||||
```cpp
|
||||
static Matrix4 RotationY(float radians)
|
||||
```
|
||||
|
||||
创建绕 Y 轴旋转的矩阵。
|
||||
|
||||
**参数:**
|
||||
- `radians` - 旋转角度(弧度)
|
||||
|
||||
**返回:** `Matrix4` - 旋转矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 rotY = Matrix4::RotationY(Math::HALF_PI);
|
||||
```
|
||||
20
docs/api/math/matrix4/rotationz.md
Normal file
20
docs/api/math/matrix4/rotationz.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Matrix4::RotationZ
|
||||
|
||||
```cpp
|
||||
static Matrix4 RotationZ(float radians)
|
||||
```
|
||||
|
||||
创建绕 Z 轴旋转的矩阵。
|
||||
|
||||
**参数:**
|
||||
- `radians` - 旋转角度(弧度)
|
||||
|
||||
**返回:** `Matrix4` - 旋转矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 rotZ = Matrix4::RotationZ(Math::HALF_PI);
|
||||
```
|
||||
20
docs/api/math/matrix4/scale.md
Normal file
20
docs/api/math/matrix4/scale.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Matrix4::Scale
|
||||
|
||||
```cpp
|
||||
static Matrix4 Scale(const Vector3& v)
|
||||
```
|
||||
|
||||
创建缩放矩阵。
|
||||
|
||||
**参数:**
|
||||
- `v` - 各轴缩放因子
|
||||
|
||||
**返回:** `Matrix4` - 缩放矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 scale = Matrix4::Scale(Vector3(2.0f, 2.0f, 2.0f));
|
||||
```
|
||||
20
docs/api/math/matrix4/translation.md
Normal file
20
docs/api/math/matrix4/translation.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Matrix4::Translation
|
||||
|
||||
```cpp
|
||||
static Matrix4 Translation(const Vector3& v)
|
||||
```
|
||||
|
||||
创建平移矩阵。
|
||||
|
||||
**参数:**
|
||||
- `v` - 平移向量
|
||||
|
||||
**返回:** `Matrix4` - 平移矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 translation = Matrix4::Translation(Vector3(1.0f, 2.0f, 3.0f));
|
||||
```
|
||||
18
docs/api/math/matrix4/transpose.md
Normal file
18
docs/api/math/matrix4/transpose.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Matrix4::Transpose
|
||||
|
||||
```cpp
|
||||
Matrix4 Transpose() const
|
||||
```
|
||||
|
||||
返回矩阵的转置。
|
||||
|
||||
**返回:** `Matrix4` - 转置矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 m = ...;
|
||||
Matrix4 transposed = m.Transpose();
|
||||
```
|
||||
22
docs/api/math/matrix4/trs.md
Normal file
22
docs/api/math/matrix4/trs.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Matrix4::TRS
|
||||
|
||||
```cpp
|
||||
static Matrix4 TRS(const Vector3& translation, const Quaternion& rotation, const Vector3& scale)
|
||||
```
|
||||
|
||||
创建完整的 TRS(平移、旋转、缩放)变换矩阵。
|
||||
|
||||
**参数:**
|
||||
- `translation` - 平移向量
|
||||
- `rotation` - 旋转四元数
|
||||
- `scale` - 缩放向量
|
||||
|
||||
**返回:** `Matrix4` - 组合变换矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 transform = Matrix4::TRS(position, rotation, Vector3::One());
|
||||
```
|
||||
17
docs/api/math/matrix4/zero.md
Normal file
17
docs/api/math/matrix4/zero.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Matrix4::Zero
|
||||
|
||||
```cpp
|
||||
static Matrix4 Zero()
|
||||
```
|
||||
|
||||
返回零矩阵。
|
||||
|
||||
**返回:** `Matrix4` - 零矩阵
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
Matrix4 zero = Matrix4::Zero();
|
||||
```
|
||||
Reference in New Issue
Block a user