natiny_entity_get_rotation
void natiny_entity_get_rotation(NatinyEntity node, uint32_t space, float* rx, float* ry, float* rz);
Writes the orientation of a node, in degrees, into three output parameters.
Parameters
| Name | Type | Description |
|---|---|---|
node |
NatinyEntity |
Entity handle |
space |
uint32_t |
NATINY_SPACE_LOCAL or NATINY_SPACE_WORLD |
rx |
float* |
Receives rotation around X, in degrees; may be NULL |
ry |
float* |
Receives rotation around Y, in degrees; may be NULL |
rz |
float* |
Receives rotation around Z, in degrees; may be NULL |
Example
float yaw;
natiny_entity_get_rotation(turret, NATINY_SPACE_WORLD, NULL, &yaw, NULL);
natiny_entity_set_rotation(barrel, NATINY_SPACE_WORLD, 0.0f, yaw, 0.0f);