2026-03-26 16:45:24 +08:00
|
|
|
# TransformComponent::Rotate
|
|
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
**命名空间**: `XCEngine::Components`
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
**类型**: `method`
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
**头文件**: `XCEngine/Components/TransformComponent.h`
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
## 签名
|
2026-03-26 16:45:24 +08:00
|
|
|
|
|
|
|
|
```cpp
|
2026-04-08 16:07:03 +08:00
|
|
|
void Rotate(const Math::Vector3& eulers, Space relativeTo = Space::Self);
|
2026-03-26 16:45:24 +08:00
|
|
|
void Rotate(const Math::Vector3& axis, float angle, Space relativeTo = Space::Self);
|
|
|
|
|
```
|
|
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
## 作用
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
执行 `FromEulerAngles`、`SetRotation`、`GetRotation` 协同流程。
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
## 当前实现
|
2026-03-26 16:45:24 +08:00
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
- 当前实现会调用 `FromEulerAngles`、`SetRotation`、`GetRotation`。
|
|
|
|
|
- 当前实现会调用 `FromAxisAngle`、`SetRotation`、`GetRotation`。
|
2026-03-26 16:45:24 +08:00
|
|
|
|
|
|
|
|
## 相关文档
|
|
|
|
|
|
2026-04-08 16:07:03 +08:00
|
|
|
- [TransformComponent](TransformComponent.md)
|