Files
XCEngine/docs/api/components/transform-component/rotate.md
ssdfasd a9d5a68dd6 docs: Add Component, GameObject, TransformComponent and Scene API documentation
- Add Component class documentation with lifecycle methods
- Add GameObject class documentation with component system
- Add TransformComponent documentation with transform methods
- Add Scene class documentation with GameObject management
- Add SceneManager singleton documentation with scene loading
- Update components.md overview with all component classes
- Update main.md navigation with Scene module
2026-03-22 03:33:55 +08:00

30 lines
790 B
Markdown

# Rotate
Rotate the transform by the specified angles.
## Syntax
```cpp
void Rotate(const Math::Vector3& eulers, Space relativeTo = Space::Self);
void Rotate(const Math::Vector3& axis, float angle, Space relativeTo = Space::Self);
```
## Parameters
- `eulers` - The Euler angles of rotation (x, y, z).
- `axis` - The axis of rotation.
- `angle` - The angle of rotation in degrees.
- `relativeTo` - Whether the rotation is relative to self or world space.
## Remarks
Applies a rotation to the transform. When `relativeTo` is `Space::Self`, the rotation is applied in local space. When `Space::World`, the rotation is applied in world space.
## Examples
```cpp
void Example(TransformComponent* transform) {
transform->Rotate(Math::Vector3(0.0f, 45.0f, 0.0f), Space::Self);
}
```