natiny_entity_set_rotation

C
void natiny_entity_set_rotation(NatinyEntity node, uint32_t space, float rx, float ry, float rz);

Sets the rotation of a node in the given coordinate space.

Parameters

Name Type Description
node NatinyEntity Entity handle
space uint32_t NATINY_SPACE_LOCAL or NATINY_SPACE_WORLD
rx float Rotation around X axis in degrees
ry float Rotation around Y axis in degrees
rz float Rotation around Z axis in degrees

Example

C
NatinyModel cube = natiny_model_create();
natiny_model_set_mesh(cube, natiny_mesh_cube(1.0f, 1.0f, 1.0f, 1));
natiny_entity_set_rotation((NatinyEntity)cube, NATINY_SPACE_LOCAL, 0.0f, 45.0f, 0.0f);

Notes

  • Use NATINY_SPACE_LOCAL for parent-relative rotation, NATINY_SPACE_WORLD for absolute rotation.