Functions
mk_model_aabbfunction
mk_aabb mk_model_aabb(mk_model_t model)
Local-space axis-aligned bounds over all primitives (node transforms applied,.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value. model transform NOT applied). Zero AABB if the model is invalid/empty.
mk_model_animation_countfunction
uint32_t mk_model_animation_count(mk_model_t model)
Number of animation clips in the model.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value.
mk_model_animation_durationfunction
float mk_model_animation_duration(mk_model_t model, uint32_t index)
Animation duration in seconds, or 0 when index is out of range.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
index | uint32_t | Zero-based index. |
Returns The resulting value.
mk_model_animation_event_addfunction
bool mk_model_animation_event_add(mk_model_t model, uint32_t animation, float time_sec, const char *name, int32_t payload)
Add model animation event.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
animation | uint32_t | Value for animation. |
time_sec | float | Value for time sec. |
name | const char * | Stable name. |
payload | int32_t | Value for payload. |
Returns True when the operation succeeds.
mk_model_animation_event_countfunction
uint32_t mk_model_animation_event_count(mk_model_t model, uint32_t animation)
Perform the model animation event count operation.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
animation | uint32_t | Value for animation. |
Returns The resulting value.
mk_model_animation_event_getfunction
bool mk_model_animation_event_get(mk_model_t model, uint32_t animation, uint32_t index, mk_model_animation_marker_t *out)
Get state from the model animation event.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
animation | uint32_t | Value for animation. |
index | uint32_t | Zero-based index. |
out | mk_model_animation_marker_t * | Value for out. |
Returns True when the operation succeeds.
mk_model_animation_events_clearfunction
void mk_model_animation_events_clear(mk_model_t model, uint32_t animation)
Clear the model animation events.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
animation | uint32_t | Value for animation. |
mk_model_animation_findfunction
int32_t mk_model_animation_find(mk_model_t model, const char *name)
Find an animation by name.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
name | const char * | Stable name. |
Returns The resulting value.
mk_model_animation_namefunction
const char * mk_model_animation_name(mk_model_t model, uint32_t index)
Animation display name, or NULL when index is out of range.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
index | uint32_t | Zero-based index. |
Returns A borrowed pointer, or NULL when unavailable.
mk_model_copy_lightsfunction
uint32_t mk_model_copy_lights(mk_model_t model, const float transform[16], mk_light_desc *out, uint32_t capacity)
Copy lights for the model.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
transform | const float | Value for transform. |
out | mk_light_desc * | Value for out. |
capacity | uint32_t | Value for capacity. |
Returns The resulting value.
mk_model_destroyfunction
void mk_model_destroy(mk_model_t model)
Immediately invalidate a model; its GPU-owned contents retire after queued frames complete.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
mk_model_drawfunction
void mk_model_draw(mk_model_t model, const float transform[16])
Submit every primitive of the model into the active pass.
transform is the model's world matrix (column-major 4x4, NULL => identity); each primitive is
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
transform | const float | Value for transform. drawn at transform * node_world. Call between mk_begin_pass/mk_end_pass. |
mk_model_draw_exfunction
void mk_model_draw_ex(mk_model_t model, const float transform[16], uint32_t filter)
Like mk_model_draw but only the primitive categories in filter (a bitmask of MK_MODEL_DRAW_*).
Drawn opaque -> transmissive -> blend so they composite correctly. Use MK_MODEL_DRAW_OPAQUE for a transmission-capture pass (exclude the refractive
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
transform | const float | Value for transform. |
filter | uint32_t | Value for filter. prims so glass doesn't refract itself). mk_model_draw == filter MK_MODEL_DRAW_ALL. |
mk_model_draw_transmissive_layerfunction
void mk_model_draw_transmissive_layer(mk_model_t model, const float transform[16], const float view_mtx[16], uint32_t layer)
Draw one transmissive primitive, sorted back-to-front for the supplied view matrix.
layer is 0-based, where 0 is the farthest transmissive primitive from the camera. This is intentionally narrow: normal model drawing still goes through mk_model_draw().
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
transform | const float | Value for transform. |
view_mtx | const float | Value for view mtx. |
layer | uint32_t | Value for layer. |
mk_model_instance_aabbfunction
mk_aabb mk_model_instance_aabb(mk_model_instance_t instance)
Current local-space bounds for the posed instance.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
Returns The resulting value.
mk_model_instance_action_clear_maskfunction
void mk_model_instance_action_clear_mask(mk_model_instance_t instance, mk_model_action_t action)
Restore full TRS influence for the action.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
mk_model_instance_action_fade_tofunction
void mk_model_instance_action_fade_to(mk_model_instance_t instance, mk_model_action_t action, float target_weight, float duration_sec)
Linearly animate the current action weight to target_weight.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
target_weight | float | Value for target weight. |
duration_sec | float | Value for duration sec. |
mk_model_instance_action_is_playingfunction
bool mk_model_instance_action_is_playing(mk_model_instance_t instance, mk_model_action_t action)
Test whether the model instance action is playing.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
Returns True when the condition holds.
mk_model_instance_action_is_validfunction
bool mk_model_instance_action_is_valid(mk_model_instance_t instance, mk_model_action_t action)
Test whether the model instance action is valid.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
Returns True when the condition holds.
mk_model_instance_action_playfunction
mk_model_action_t mk_model_instance_action_play(mk_model_instance_t instance, uint32_t animation, uint32_t flags)
Start an independently controlled animation action at time zero, speed 1, and weight 1.
Use MK_MODEL_PLAY_ADDITIVE to apply its rest-pose delta after
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
animation | uint32_t | Value for animation. |
flags | uint32_t | Value for flags. |
Returns The resulting handle or value. normal blending. Returns MK_MODEL_ACTION_INVALID when no slot is available.
mk_model_instance_action_removefunction
void mk_model_instance_action_remove(mk_model_instance_t instance, mk_model_action_t action)
Remove model instance action.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
mk_model_instance_action_set_maskfunction
bool mk_model_instance_action_set_mask(mk_model_instance_t instance, mk_model_action_t action, mk_model_mask_t mask)
Copy a reusable mask onto an action.
Returns false for invalid handles or a
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
mask | mk_model_mask_t | Value for mask. |
Returns True when the operation succeeds. mask created for another model.
mk_model_instance_action_set_playingfunction
void mk_model_instance_action_set_playing(mk_model_instance_t instance, mk_model_action_t action, bool playing)
Set playing on the model instance action.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
playing | bool | Value for playing. |
mk_model_instance_action_set_speedfunction
void mk_model_instance_action_set_speed(mk_model_instance_t instance, mk_model_action_t action, float speed)
Set speed on the model instance action.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
speed | float | Value for speed. |
mk_model_instance_action_set_timefunction
void mk_model_instance_action_set_time(mk_model_instance_t instance, mk_model_action_t action, float time_sec)
Set time on the model instance action.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
time_sec | float | Value for time sec. |
mk_model_instance_action_set_weightfunction
void mk_model_instance_action_set_weight(mk_model_instance_t instance, mk_model_action_t action, float weight)
Set weight on the model instance action.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
weight | float | Value for weight. |
mk_model_instance_action_speedfunction
float mk_model_instance_action_speed(mk_model_instance_t instance, mk_model_action_t action)
Perform the model instance action speed operation.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
Returns The resulting value.
mk_model_instance_action_timefunction
float mk_model_instance_action_time(mk_model_instance_t instance, mk_model_action_t action)
Perform the model instance action time operation.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
Returns The resulting value.
mk_model_instance_action_weightfunction
float mk_model_instance_action_weight(mk_model_instance_t instance, mk_model_action_t action)
Perform the model instance action weight operation.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
action | mk_model_action_t | Value for action. |
Returns The resulting value.
mk_model_instance_clear_animation_eventsfunction
void mk_model_instance_clear_animation_events(mk_model_instance_t instance)
Clear the animation events for the model instance.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
mk_model_instance_consume_root_motionfunction
mk_model_root_motion_t mk_model_instance_consume_root_motion(mk_model_instance_t instance)
Return and reset motion accumulated since the previous consume.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
Returns The resulting handle or value.
mk_model_instance_copy_lightsfunction
uint32_t mk_model_instance_copy_lights(mk_model_instance_t instance, const float transform[16], mk_light_desc *out, uint32_t capacity)
Copy lights for the model instance.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
transform | const float | Value for transform. |
out | mk_light_desc * | Value for out. |
capacity | uint32_t | Value for capacity. |
Returns The resulting value.
mk_model_instance_createfunction
mk_model_instance_t mk_model_instance_create(mk_model_t model)
Create an independent posed instance of a loaded model.
Instances own playback
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting handle or value. state and any dynamic vertex buffers needed for skinning/morphing.
mk_model_instance_crossfadefunction
mk_model_action_t mk_model_instance_crossfade(mk_model_instance_t instance, uint32_t animation, float duration_sec, uint32_t flags)
Crossfade all normal actions to a new looping or one-shot normal action.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
animation | uint32_t | Value for animation. |
duration_sec | float | Value for duration sec. |
flags | uint32_t | Value for flags. |
Returns The resulting handle or value. Additive actions are left untouched. Faded-out sources are removed.
mk_model_instance_destroyfunction
void mk_model_instance_destroy(mk_model_instance_t instance)
Destroy an instance.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
mk_model_instance_drawfunction
void mk_model_instance_draw(mk_model_instance_t instance, const float transform[16])
Draw the current instance pose.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
transform | const float | Value for transform. |
mk_model_instance_draw_exfunction
void mk_model_instance_draw_ex(mk_model_instance_t instance, const float transform[16], uint32_t filter)
Draw ex for the model instance.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
transform | const float | Value for transform. |
filter | uint32_t | Value for filter. |
mk_model_instance_draw_transmissive_layerfunction
void mk_model_instance_draw_transmissive_layer(mk_model_instance_t instance, const float transform[16], const float view_mtx[16], uint32_t layer)
Draw transmissive layer for the model instance.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
transform | const float | Value for transform. |
view_mtx | const float | Value for view mtx. |
layer | uint32_t | Value for layer. |
mk_model_instance_is_validfunction
bool mk_model_instance_is_valid(mk_model_instance_t instance)
Test whether the model instance is valid.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
Returns True when the condition holds.
mk_model_instance_light_countfunction
uint32_t mk_model_instance_light_count(mk_model_instance_t instance)
Perform the model instance light count operation.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
Returns The resulting value.
mk_model_instance_pinfunction
bool mk_model_instance_pin(mk_model_instance_t instance)
Perform the model instance pin operation.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
Returns True when the operation succeeds.
mk_model_instance_playfunction
bool mk_model_instance_play(mk_model_instance_t instance, uint32_t animation, uint32_t flags)
Start playing an animation clip.
Time resets to zero. flags is MK_MODEL_PLAY_*.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
animation | uint32_t | Value for animation. |
flags | uint32_t | Value for flags. |
Returns True when the operation succeeds. Returns false for invalid instance/model/animation.
mk_model_instance_poll_animation_eventfunction
bool mk_model_instance_poll_animation_event(mk_model_instance_t instance, mk_model_animation_event_t *out)
Poll one queued marker event.
Events are ordered by crossing time within an
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
out | mk_model_animation_event_t * | Value for out. |
Returns True when the operation succeeds. update. Seeking does not enqueue events.
mk_model_instance_primary_actionfunction
mk_model_action_t mk_model_instance_primary_action(mk_model_instance_t instance)
Most recently started normal action, or MK_MODEL_ACTION_INVALID.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
Returns The resulting handle or value.
mk_model_instance_set_root_motionfunction
bool mk_model_instance_set_root_motion(mk_model_instance_t instance, uint32_t node, uint32_t flags)
Enable extraction from an explicit node.
flags is MK_MODEL_ROOT_MOTION_*. Selected components are removed from the rendered pose. Passing zero flags
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
node | uint32_t | Value for node. |
flags | uint32_t | Value for flags. |
Returns True when the operation succeeds. disables extraction.
mk_model_instance_set_speedfunction
void mk_model_instance_set_speed(mk_model_instance_t instance, float speed)
Set the instance-wide playback speed multiplier.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
speed | float | Value for speed. |
mk_model_instance_set_timefunction
void mk_model_instance_set_time(mk_model_instance_t instance, float time_sec)
Set current animation time in seconds.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
time_sec | float | Value for time sec. |
mk_model_instance_stopfunction
void mk_model_instance_stop(mk_model_instance_t instance)
Stop playback, keeping the current pose.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
mk_model_instance_timefunction
float mk_model_instance_time(mk_model_instance_t instance)
Current animation time in seconds.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
Returns The resulting value.
mk_model_instance_transmissive_countfunction
uint32_t mk_model_instance_transmissive_count(mk_model_instance_t instance)
Animated instance transmissive helpers, matching the model-level helpers.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
Returns The resulting value.
mk_model_instance_unpinfunction
void mk_model_instance_unpin(mk_model_instance_t instance)
Perform the model instance unpin operation.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
mk_model_instance_updatefunction
void mk_model_instance_update(mk_model_instance_t instance, float dt_sec)
Advance playback and update the instance pose/dynamic geometry.
| Parameter | Type | Description |
|---|
instance | mk_model_instance_t | Value for instance. |
dt_sec | float | Value for dt sec. |
mk_model_is_validfunction
bool mk_model_is_valid(mk_model_t model)
Test whether the model is valid.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns True when the condition holds.
mk_model_light_countfunction
uint32_t mk_model_light_count(mk_model_t model)
Perform the model light count operation.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value.
mk_model_loadfunction
mk_model_t mk_model_load(const char *path, uint32_t flags)
Load a model from a file path.
Returns MK_MODEL_INVALID on failure (logged).
| Parameter | Type | Description |
|---|
path | const char * | Value for path. |
flags | uint32_t | Value for flags. |
Returns The resulting handle or value. External buffers/images referenced by the file are resolved relative to it.
mk_model_mask_createfunction
mk_model_mask_t mk_model_mask_create(mk_model_t model, float default_weight)
Create model mask.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
default_weight | float | Value for default weight. |
Returns The resulting handle or value.
mk_model_mask_destroyfunction
void mk_model_mask_destroy(mk_model_mask_t mask)
Destroy the model mask.
| Parameter | Type | Description |
|---|
mask | mk_model_mask_t | Value for mask. |
mk_model_mask_set_nodefunction
bool mk_model_mask_set_node(mk_model_mask_t mask, uint32_t node, float weight, bool include_descendants)
Set one node's 0..1 weight.
When include_descendants is true, applies to the
| Parameter | Type | Description |
|---|
mask | mk_model_mask_t | Value for mask. |
node | uint32_t | Value for node. |
weight | float | Value for weight. |
include_descendants | bool | Value for include descendants. |
Returns True when the operation succeeds. complete node subtree.
mk_model_material_countfunction
uint32_t mk_model_material_count(mk_model_t model)
Number of distinct material slots extracted from the file.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value.
mk_model_mesh_countfunction
uint32_t mk_model_mesh_count(mk_model_t model)
Number of drawable primitives (one per mesh primitive, after node flatten).
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value.
mk_model_node_countfunction
uint32_t mk_model_node_count(mk_model_t model)
Number of scene/skeleton nodes in the model.
Node indices are stable for the
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value. lifetime of the model and are used by masks and root motion.
mk_model_node_findfunction
int32_t mk_model_node_find(mk_model_t model, const char *name)
Find the first node with an exact name match.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
name | const char * | Stable name. |
Returns The resulting value.
mk_model_node_namefunction
const char * mk_model_node_name(mk_model_t model, uint32_t node)
Node display name, or NULL when the index is out of range.
Unnamed nodes
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
node | uint32_t | Value for node. |
Returns A borrowed pointer, or NULL when unavailable. return an empty string.
mk_model_node_parentfunction
int32_t mk_model_node_parent(mk_model_t model, uint32_t node)
Parent node index, or -1 for a root or invalid node.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
node | uint32_t | Value for node. |
Returns The resulting value.
mk_model_pinfunction
bool mk_model_pin(mk_model_t model)
Perform the model pin operation.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns True when the operation succeeds.
mk_model_set_variantfunction
bool mk_model_set_variant(mk_model_t model, int32_t index)
Select a KHR_materials_variants entry.
Pass -1 to restore the glTF default material
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
index | int32_t | Zero-based index. |
Returns True when the operation succeeds. bindings. Returns false when the model is invalid or the index is out of range.
mk_model_system_shutdownfunction
void mk_model_system_shutdown(void)
Perform the model system shutdown operation.
mk_model_transmissive_countfunction
uint32_t mk_model_transmissive_count(mk_model_t model)
Count transmissive primitives in the loaded model.
Useful for layered transmission passes where each glass primitive is composited into the capture
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value. one at a time.
mk_model_unpinfunction
void mk_model_unpin(mk_model_t model)
Perform the model unpin operation.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
mk_model_variant_countfunction
uint32_t mk_model_variant_count(mk_model_t model)
Number of KHR_materials_variants entries.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value.
mk_model_variant_indexfunction
int32_t mk_model_variant_index(mk_model_t model)
Current selected variant index, or -1 for the glTF default material bindings.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
Returns The resulting value.
mk_model_variant_namefunction
const char * mk_model_variant_name(mk_model_t model, uint32_t index)
Variant display name, or NULL when index is out of range.
| Parameter | Type | Description |
|---|
model | mk_model_t | Value for model. |
index | uint32_t | Zero-based index. |
Returns A borrowed pointer, or NULL when unavailable.