23 lines
396 B
Markdown
23 lines
396 B
Markdown
|
|
# Transform::TransformDirection
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
Vector3 TransformDirection(const Vector3& direction) const
|
||
|
|
```
|
||
|
|
|
||
|
|
变换方向(仅旋转,包含缩放)。
|
||
|
|
|
||
|
|
**参数:**
|
||
|
|
- `direction` - 要变换的方向
|
||
|
|
|
||
|
|
**返回:** `Vector3` - 变换后的方向
|
||
|
|
|
||
|
|
**复杂度:** O(1)
|
||
|
|
|
||
|
|
**示例:**
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
Transform t;
|
||
|
|
Vector3 localDir(1.0f, 0.0f, 0.0f);
|
||
|
|
Vector3 worldDir = t.TransformDirection(localDir);
|
||
|
|
```
|