docs: update math API docs

This commit is contained in:
2026-03-20 02:35:15 +08:00
parent e165dbea1c
commit c5b17239ca
243 changed files with 5307 additions and 1327 deletions

View File

@@ -1,23 +1,37 @@
# Matrix4::Perspective
# Matrix4x4::Perspective
```cpp
static Matrix4 Perspective(float fov, float aspect, float near, float far)
static Matrix4x4 Perspective(float fov, float aspect, float near, float far)
```
创建透视投影矩阵。
创建透视投影矩阵。用于将 3D 场景投影到 2D 视口,产生近大远小的效果。
**参数:**
- `fov` - 垂直视野角度(弧度)
- `aspect` - 宽高比
- `near` - 近裁面距离
- `far` - 远裁面距离
- `aspect` - 宽高比width / height
- `near` - 近裁面距离
- `far` - 远裁面距离
**返回:** `Matrix4` - 透视投影矩阵
**返回:** 透视投影矩阵
**线程安全:**
**复杂度:** O(1)
**示例:**
```cpp
Matrix4 proj = Matrix4::Perspective(45.0f * DEG_TO_RAD, aspect, 0.1f, 100.0f);
#include "XCEngine/Math/Matrix4.h"
using namespace XCEngine::Math;
float fov = 60.0f * 3.14159265f / 180.0f;
float aspect = 16.0f / 9.0f;
Matrix4 proj = Matrix4::Perspective(fov, aspect, 0.1f, 100.0f);
```
## 相关文档
- [Matrix4](matrix4.md) - 返回类总览
- [Orthographic](orthographic.md) - 正交投影
- [LookAt](lookat.md) - 视图矩阵