natiny_pivot_create

C
NatinyPivot natiny_pivot_create(void);

Creates a transform-only entity for grouping and positioning child entities. The pivot itself is not rendered and produces no audio.

Returns

Type Description
NatinyPivot Pivot handle usable as a NatinyEntity, or 0 on failure

Example

C
NatinyPivot turret = natiny_pivot_create();
natiny_entity_set_parent((NatinyEntity)turret, (NatinyEntity)tank);
natiny_entity_set_position((NatinyEntity)turret, NATINY_SPACE_LOCAL,
                           0.0f, 1.2f, 0.0f);
natiny_entity_set_parent((NatinyEntity)barrel, (NatinyEntity)turret);

Notes

  • The initial position and rotation are 0; the initial scale is 1.0f on every axis. The pivot has no parent.
  • Use the natiny_entity_* API to transform or parent a pivot.
  • Destroy the pivot with natiny_pivot_destroy. Destroying it also destroys its descendants.