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
This commit is contained in:
31
docs/api/components/transform-component/set-parent.md
Normal file
31
docs/api/components/transform-component/set-parent.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# SetParent
|
||||
|
||||
Set the parent transform.
|
||||
|
||||
## Syntax
|
||||
|
||||
```cpp
|
||||
void SetParent(TransformComponent* parent, bool worldPositionStays = true);
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- `parent` - The new parent transform, or `nullptr` to detach from parent.
|
||||
- `worldPositionStays` - If `true`, the world position remains unchanged after reparenting.
|
||||
|
||||
## Remarks
|
||||
|
||||
Sets the parent of this transform. When `worldPositionStays` is `true`, the world position is preserved, which may adjust the local position. When `false`, the local position is preserved, which may adjust the world position.
|
||||
|
||||
## See Also
|
||||
|
||||
- [GetParent](get-parent)
|
||||
- [DetachChildren](detach-children)
|
||||
|
||||
## Examples
|
||||
|
||||
```cpp
|
||||
void Example(TransformComponent* child, TransformComponent* newParent) {
|
||||
child->SetParent(newParent, true);
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user