natiny_model_set_mesh

C
void natiny_model_set_mesh(NatinyModel model, NatinyMesh mesh);

Sets which geometry this model places.

Parameters

Name Type Description
model NatinyModel Model handle
mesh NatinyMesh Mesh handle, or 0 to empty the model

Example

C
natiny_model_set_mesh(box, sphere_mesh);

Notes

  • A model with no mesh draws nothing and is skipped by every pass; 0 puts it back in that state without destroying it.
  • Any per-part overrides set with natiny_model_set_part_material or natiny_model_set_part_texture are cleared, because they were indexed by the old mesh's parts and mean nothing against the new one's.
  • The mesh is not copied. Several models may point at one, and destroying the mesh leaves them drawing nothing rather than crashing.