Fixed broken references: - texture-import-settings: Fix 16 files referencing wrong overview filename - math/rectint: Fix 9 method links (rectint-* → get*, contains, intersects) - rhi/opengl/device: Fix 8 cross-references (opengl-* → */**) - resources/mesh: Fix meshsection and vertexattribute links - rhi/d3d12/sampler: Fix RHISampler reference path - math/vector3: Fix projectonplane → project-on-plane - rhi/opengl/command-list: Remove broken ClearFlag enum ref - rhi/opengl/device: Create 2 new method docs (MakeContextCurrent, GetNativeContext) - rhi/device: Fix device-info types reference All 0 broken references remaining.
38 lines
803 B
Markdown
38 lines
803 B
Markdown
# Quaternion::ToEulerAngles
|
|
|
|
```cpp
|
|
Vector3 ToEulerAngles() const;
|
|
```
|
|
|
|
将四元数转换为欧拉角。返回顺序为 (pitch, yaw, roll),单位为弧度。
|
|
|
|
**返回:** 欧拉角向量 (pitch, yaw, roll),单位为弧度
|
|
|
|
**线程安全:** ✅
|
|
|
|
**复杂度:** O(1)
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
#include <XCEngine/Core/Math/Quaternion.h>
|
|
#include <XCEngine/Core/Math/Vector3.h>
|
|
#include <XCEngine/Core/Math/Math.h>
|
|
|
|
using namespace XCEngine::Math;
|
|
|
|
Quaternion q = Quaternion::FromEulerAngles(
|
|
Math::Radians(45.0f),
|
|
Math::Radians(30.0f),
|
|
Math::Radians(60.0f)
|
|
);
|
|
|
|
Vector3 euler = q.ToEulerAngles();
|
|
// euler.x ≈ 45°, euler.y ≈ 30°, euler.z ≈ 60°
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [Quaternion](quaternion.md) - 返回类总览
|
|
- [FromEulerAngles](from-euler-angles.md) - 从欧拉角创建
|