- Vector4.md: Add index mapping (0=x, 1=y, 2=z, 3=w) to operator[] description - Transform.md: Add proper '运算符' subsection header for operator* documentation Found and fixed missing operator documentation: - Vector4: operator[] index mapping was undocumented - Transform: operator* was listed without proper section header
50 lines
1.3 KiB
Markdown
50 lines
1.3 KiB
Markdown
# 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 模块总览
|