docs: update math API docs
This commit is contained in:
33
docs/api/math/quaternion/look-rotation.md
Normal file
33
docs/api/math/quaternion/look-rotation.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Quaternion::LookRotation
|
||||
|
||||
```cpp
|
||||
static Quaternion LookRotation(const Vector3& forward, const Vector3& up = Vector3::Up());
|
||||
```
|
||||
|
||||
创建使 forward 方向朝向目标的旋转四元数。
|
||||
|
||||
**参数:**
|
||||
- `forward` - 前向方向(会被归一化)
|
||||
- `up` - 向上方向,默认为 Y 轴正方向
|
||||
|
||||
**返回:** 使 forward 朝向目标的旋转四元数
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
Quaternion q = Quaternion::LookRotation(Vector3(1, 0, 0));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Quaternion](quaternion.md) - 返回类总览
|
||||
- [FromAxisAngle](from-axis-angle.md) - 从轴角创建
|
||||
Reference in New Issue
Block a user