natiny_entity_get_scale
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
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
spaceargument becausenatiny_entity_set_scalehas 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.0fto every non-NULLoutput, and so does a handle that is not a live node.