natiny_entity_get_scale

C
void natiny_entity_get_scale(NatinyEntity node, float* sx, float* sy, float* sz);

Writes the scale factors of a node into three output parameters.

Parameters

Name Type Description
node NatinyEntity Entity handle
sx float* Receives the scale factor along X; may be NULL
sy float* Receives the scale factor along Y; may be NULL
sz float* Receives the scale factor along Z; may be NULL

Example

C
float sx, sy, sz;
natiny_entity_get_scale(cube, &sx, &sy, &sz);
natiny_entity_set_scale(cube, sx * 1.1f, sy * 1.1f, sz * 1.1f);

Notes

  • There is no space argument because natiny_entity_set_scale has none: this returns exactly the three numbers that were written. A node under a scaled parent is drawn scaled without its own three changing.
  • A node that was never scaled writes 1.0f to every non-NULL output, and so does a handle that is not a live node.