natiny_camera_destroy
void natiny_camera_destroy(NatinyCamera cam);
Destroys a camera and frees its resources.
Parameters
| Name | Type | Description |
|---|---|---|
cam |
NatinyCamera |
Camera handle from natiny_camera_create |
Example
NatinyCamera cam = natiny_camera_create();
/* use cam... */
natiny_camera_destroy(cam);
Notes
- Everything parented to the camera is destroyed with it, and so is everything parented to those, all the way down. Each one goes through the destroy its own kind has, so a child model gives back its parts, a child body leaves the physics world and a child source releases its voice - a subtree is freed as completely as its nodes would be one at a time.
- Detach a child to keep it:
natiny_entity_set_parent(child, 0)leaves its local transform as its world transform, and the destroy passes it by. - Do not use the camera handle after destroy.