modelio-rs 0.2.0

Safe Rust bindings for Apple's ModelIO framework — assets, meshes, materials, lights, cameras, voxels, textures, and animation on macOS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
#![allow(missing_docs)]

use core::ffi::{c_char, c_void};

extern "C" {
    pub fn mdl_object_retain(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_object_release(handle: *mut c_void);

    pub fn mdl_asset_new_empty(
        out_asset: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_asset_new_with_url(
        path: *const c_char,
        out_asset: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_asset_can_import_file_extension(path_extension: *const c_char) -> i32;
    pub fn mdl_asset_can_export_file_extension(path_extension: *const c_char) -> i32;
    pub fn mdl_asset_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_asset_count(handle: *mut c_void) -> u64;
    pub fn mdl_asset_bounding_box(
        handle: *mut c_void,
        out_min_x: *mut f32,
        out_min_y: *mut f32,
        out_min_z: *mut f32,
        out_max_x: *mut f32,
        out_max_y: *mut f32,
        out_max_z: *mut f32,
    );
    pub fn mdl_asset_bounding_box_at_time(
        handle: *mut c_void,
        time: f64,
        out_min_x: *mut f32,
        out_min_y: *mut f32,
        out_min_z: *mut f32,
        out_max_x: *mut f32,
        out_max_y: *mut f32,
        out_max_z: *mut f32,
    );
    pub fn mdl_asset_url_string(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_asset_object_at_index(handle: *mut c_void, index: u64) -> *mut c_void;
    pub fn mdl_asset_mesh_at_index(handle: *mut c_void, index: u64) -> *mut c_void;
    pub fn mdl_asset_object_at_path(handle: *mut c_void, path: *const c_char) -> *mut c_void;
    pub fn mdl_asset_add_object(handle: *mut c_void, object: *mut c_void);
    pub fn mdl_asset_remove_object(handle: *mut c_void, object: *mut c_void);
    pub fn mdl_asset_load_textures(handle: *mut c_void);
    pub fn mdl_asset_export_to_url(
        handle: *mut c_void,
        path: *const c_char,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_asset_frame_interval(handle: *mut c_void) -> f64;
    pub fn mdl_asset_set_frame_interval(handle: *mut c_void, value: f64);
    pub fn mdl_asset_start_time(handle: *mut c_void) -> f64;
    pub fn mdl_asset_set_start_time(handle: *mut c_void, value: f64);
    pub fn mdl_asset_end_time(handle: *mut c_void) -> f64;
    pub fn mdl_asset_set_end_time(handle: *mut c_void, value: f64);
    pub fn mdl_asset_up_axis(
        handle: *mut c_void,
        out_x: *mut f32,
        out_y: *mut f32,
        out_z: *mut f32,
    );
    pub fn mdl_asset_set_up_axis(handle: *mut c_void, x: f32, y: f32, z: f32);

    pub fn mdl_mesh_new_box(
        extent_x: f32,
        extent_y: f32,
        extent_z: f32,
        segment_x: u32,
        segment_y: u32,
        segment_z: u32,
        inward_normals: i32,
        geometry_type: i32,
        out_mesh: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_mesh_new_ellipsoid(
        extent_x: f32,
        extent_y: f32,
        extent_z: f32,
        segment_x: u32,
        segment_y: u32,
        inward_normals: i32,
        hemisphere: i32,
        geometry_type: i32,
        out_mesh: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_mesh_new_cylinder(
        extent_x: f32,
        extent_y: f32,
        extent_z: f32,
        segment_x: u32,
        segment_y: u32,
        inward_normals: i32,
        top_cap: i32,
        bottom_cap: i32,
        geometry_type: i32,
        out_mesh: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_mesh_new_plane(
        extent_x: f32,
        extent_y: f32,
        extent_z: f32,
        segment_x: u32,
        segment_y: u32,
        geometry_type: i32,
        out_mesh: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_mesh_new_icosahedron(
        extent_x: f32,
        extent_y: f32,
        extent_z: f32,
        inward_normals: i32,
        geometry_type: i32,
        out_mesh: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_mesh_vertex_count(handle: *mut c_void) -> u64;
    pub fn mdl_mesh_vertex_buffer_count(handle: *mut c_void) -> u64;
    pub fn mdl_mesh_vertex_buffer_at(handle: *mut c_void, index: u64) -> *mut c_void;
    pub fn mdl_mesh_submesh_count(handle: *mut c_void) -> u64;
    pub fn mdl_mesh_submesh_at(handle: *mut c_void, index: u64) -> *mut c_void;
    pub fn mdl_mesh_bounding_box(
        handle: *mut c_void,
        out_min_x: *mut f32,
        out_min_y: *mut f32,
        out_min_z: *mut f32,
        out_max_x: *mut f32,
        out_max_y: *mut f32,
        out_max_z: *mut f32,
    );
    pub fn mdl_mesh_vertex_descriptor(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_mesh_vertex_attribute_data(
        handle: *mut c_void,
        attribute_name: *const c_char,
    ) -> *mut c_void;
    pub fn mdl_mesh_buffer_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_mesh_buffer_copy_bytes(
        handle: *mut c_void,
        out_bytes: *mut u8,
        capacity: u64,
    ) -> u64;
    pub fn mdl_vertex_attribute_data_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_vertex_attribute_data_copy_bytes(
        handle: *mut c_void,
        out_bytes: *mut u8,
        capacity: u64,
    ) -> u64;

    pub fn mdl_submesh_index_count(handle: *mut c_void) -> u64;
    pub fn mdl_submesh_index_type(handle: *mut c_void) -> u32;
    pub fn mdl_submesh_geometry_type(handle: *mut c_void) -> i32;
    pub fn mdl_submesh_name_string(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_submesh_set_name(handle: *mut c_void, name: *const c_char);
    pub fn mdl_submesh_index_buffer(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_submesh_index_buffer_as_type(handle: *mut c_void, index_type: u32) -> *mut c_void;
    pub fn mdl_submesh_material(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_submesh_set_material(handle: *mut c_void, material: *mut c_void);

    pub fn mdl_material_new(
        name: *const c_char,
        physically_plausible: i32,
        out_material: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_material_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_material_count(handle: *mut c_void) -> u64;
    pub fn mdl_material_name_string(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_material_material_face(handle: *mut c_void) -> u32;
    pub fn mdl_material_set_material_face(handle: *mut c_void, face: u32);
    pub fn mdl_material_remove_all_properties(handle: *mut c_void);
    pub fn mdl_material_property_at(handle: *mut c_void, index: u64) -> *mut c_void;
    pub fn mdl_material_property_named(
        handle: *mut c_void,
        property_name: *const c_char,
    ) -> *mut c_void;
    pub fn mdl_material_property_with_semantic(handle: *mut c_void, semantic: u32) -> *mut c_void;
    pub fn mdl_material_property_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_material_property_texture(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_material_property_set_float(handle: *mut c_void, value: f32);
    pub fn mdl_material_property_set_float2(handle: *mut c_void, x: f32, y: f32);
    pub fn mdl_material_property_set_float3(handle: *mut c_void, x: f32, y: f32, z: f32);
    pub fn mdl_material_property_set_float4(handle: *mut c_void, x: f32, y: f32, z: f32, w: f32);
    pub fn mdl_material_property_set_matrix4x4(handle: *mut c_void, values: *const f32);
    pub fn mdl_material_property_set_string(handle: *mut c_void, value: *const c_char);
    pub fn mdl_material_property_set_url(handle: *mut c_void, value: *const c_char);
    pub fn mdl_material_property_set_color(
        handle: *mut c_void,
        red: f32,
        green: f32,
        blue: f32,
        alpha: f32,
    );
    pub fn mdl_material_property_set_luminance(handle: *mut c_void, value: f32);

    pub fn mdl_url_texture_new(
        path: *const c_char,
        name: *const c_char,
        out_texture: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_checkerboard_texture_new(
        divisions: f32,
        name: *const c_char,
        width: i32,
        height: i32,
        channel_count: u64,
        channel_encoding: i32,
        color1_r: f32,
        color1_g: f32,
        color1_b: f32,
        color1_a: f32,
        color2_r: f32,
        color2_g: f32,
        color2_b: f32,
        color2_a: f32,
        out_texture: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_texture_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_texture_write_to_url(
        handle: *mut c_void,
        path: *const c_char,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_texture_texel_data_length(handle: *mut c_void, top_left_origin: i32) -> u64;
    pub fn mdl_texture_copy_texel_data(
        handle: *mut c_void,
        top_left_origin: i32,
        out_bytes: *mut u8,
        capacity: u64,
    ) -> u64;

    pub fn mdl_object_new(out_object: *mut *mut c_void, out_error_message: *mut *mut c_char)
        -> i32;
    pub fn mdl_object_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_object_kind(handle: *mut c_void) -> i32;
    pub fn mdl_object_name_string(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_object_set_name(handle: *mut c_void, name: *const c_char);
    pub fn mdl_object_path_string(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_object_hidden(handle: *mut c_void) -> i32;
    pub fn mdl_object_set_hidden(handle: *mut c_void, hidden: i32);
    pub fn mdl_object_add_child(handle: *mut c_void, child: *mut c_void);
    pub fn mdl_object_child_count(handle: *mut c_void) -> u64;
    pub fn mdl_object_child_at(handle: *mut c_void, index: u64) -> *mut c_void;
    pub fn mdl_object_at_path(handle: *mut c_void, path: *const c_char) -> *mut c_void;
    pub fn mdl_object_bounding_box_at_time(
        handle: *mut c_void,
        time: f64,
        out_min_x: *mut f32,
        out_min_y: *mut f32,
        out_min_z: *mut f32,
        out_max_x: *mut f32,
        out_max_y: *mut f32,
        out_max_z: *mut f32,
    );

    pub fn mdl_light_new(out_light: *mut *mut c_void, out_error_message: *mut *mut c_char) -> i32;
    pub fn mdl_light_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_light_set_light_type(handle: *mut c_void, raw_value: u32);
    pub fn mdl_light_set_color_space(handle: *mut c_void, color_space: *const c_char);
    pub fn mdl_light_irradiance_at_point(
        handle: *mut c_void,
        x: f32,
        y: f32,
        z: f32,
        out_r: *mut f32,
        out_g: *mut f32,
        out_b: *mut f32,
        out_a: *mut f32,
    );

    pub fn mdl_physically_plausible_light_new(
        out_light: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_physically_plausible_light_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_physically_plausible_light_set_color_temperature(
        handle: *mut c_void,
        temperature: f32,
    );
    pub fn mdl_physically_plausible_light_set_color(
        handle: *mut c_void,
        red: f32,
        green: f32,
        blue: f32,
        alpha: f32,
    );
    pub fn mdl_physically_plausible_light_set_lumens(handle: *mut c_void, lumens: f32);
    pub fn mdl_physically_plausible_light_set_inner_cone_angle(handle: *mut c_void, angle: f32);
    pub fn mdl_physically_plausible_light_set_outer_cone_angle(handle: *mut c_void, angle: f32);
    pub fn mdl_physically_plausible_light_set_attenuation_start_distance(
        handle: *mut c_void,
        distance: f32,
    );
    pub fn mdl_physically_plausible_light_set_attenuation_end_distance(
        handle: *mut c_void,
        distance: f32,
    );

    pub fn mdl_camera_new(out_camera: *mut *mut c_void, out_error_message: *mut *mut c_char)
        -> i32;
    pub fn mdl_camera_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_camera_set_projection(handle: *mut c_void, raw_value: u32);
    pub fn mdl_camera_set_near_visibility_distance(handle: *mut c_void, value: f32);
    pub fn mdl_camera_set_far_visibility_distance(handle: *mut c_void, value: f32);
    pub fn mdl_camera_set_world_to_meters_conversion_scale(handle: *mut c_void, value: f32);
    pub fn mdl_camera_set_focal_length(handle: *mut c_void, value: f32);
    pub fn mdl_camera_set_focus_distance(handle: *mut c_void, value: f32);
    pub fn mdl_camera_set_field_of_view(handle: *mut c_void, value: f32);
    pub fn mdl_camera_look_at(handle: *mut c_void, x: f32, y: f32, z: f32);
    pub fn mdl_camera_look_at_from(
        handle: *mut c_void,
        focus_x: f32,
        focus_y: f32,
        focus_z: f32,
        camera_x: f32,
        camera_y: f32,
        camera_z: f32,
    );
    pub fn mdl_camera_frame_bounding_box(
        handle: *mut c_void,
        min_x: f32,
        min_y: f32,
        min_z: f32,
        max_x: f32,
        max_y: f32,
        max_z: f32,
        set_near_and_far: i32,
    );
    pub fn mdl_camera_ray_to(
        handle: *mut c_void,
        pixel_x: i32,
        pixel_y: i32,
        viewport_width: i32,
        viewport_height: i32,
        out_x: *mut f32,
        out_y: *mut f32,
        out_z: *mut f32,
    );
    pub fn mdl_camera_bokeh_kernel(handle: *mut c_void, width: i32, height: i32) -> *mut c_void;

    pub fn mdl_voxel_array_new_with_indices(
        values: *const i32,
        count: u64,
        min_x: f32,
        min_y: f32,
        min_z: f32,
        max_x: f32,
        max_y: f32,
        max_z: f32,
        voxel_extent: f32,
        out_voxel_array: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_voxel_array_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_voxel_array_count(handle: *mut c_void) -> u64;
    pub fn mdl_voxel_array_set_voxel(handle: *mut c_void, x: i32, y: i32, z: i32, shell: i32);
    pub fn mdl_voxel_array_voxel_exists(
        handle: *mut c_void,
        x: i32,
        y: i32,
        z: i32,
        shell: i32,
        allow_any_x: i32,
        allow_any_y: i32,
        allow_any_z: i32,
        allow_any_shell: i32,
    ) -> i32;
    pub fn mdl_voxel_array_copy_indices(
        handle: *mut c_void,
        out_values: *mut i32,
        capacity_indices: u64,
    ) -> u64;
    pub fn mdl_voxel_array_copy_voxels_within_extent(
        handle: *mut c_void,
        min_x: i32,
        min_y: i32,
        min_z: i32,
        min_shell: i32,
        max_x: i32,
        max_y: i32,
        max_z: i32,
        max_shell: i32,
        out_values: *mut i32,
        capacity_indices: u64,
    ) -> u64;
    pub fn mdl_voxel_array_union(handle: *mut c_void, other: *mut c_void);
    pub fn mdl_voxel_array_intersect(handle: *mut c_void, other: *mut c_void);
    pub fn mdl_voxel_array_difference(handle: *mut c_void, other: *mut c_void);
    pub fn mdl_voxel_array_index_of_spatial_location(
        handle: *mut c_void,
        x: f32,
        y: f32,
        z: f32,
        out_values: *mut i32,
    );
    pub fn mdl_voxel_array_spatial_location_of_index(
        handle: *mut c_void,
        x: i32,
        y: i32,
        z: i32,
        shell: i32,
        out_x: *mut f32,
        out_y: *mut f32,
        out_z: *mut f32,
    );
    pub fn mdl_voxel_array_voxel_bounding_box_at_index(
        handle: *mut c_void,
        x: i32,
        y: i32,
        z: i32,
        shell: i32,
        out_min_x: *mut f32,
        out_min_y: *mut f32,
        out_min_z: *mut f32,
        out_max_x: *mut f32,
        out_max_y: *mut f32,
        out_max_z: *mut f32,
    );
    pub fn mdl_voxel_array_convert_to_signed_shell_field(handle: *mut c_void);
    pub fn mdl_voxel_array_set_shell_field_interior_thickness(handle: *mut c_void, value: f32);
    pub fn mdl_voxel_array_set_shell_field_exterior_thickness(handle: *mut c_void, value: f32);
    pub fn mdl_voxel_array_coarse_mesh(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_voxel_array_mesh(handle: *mut c_void) -> *mut c_void;

    pub fn mdl_animated_value_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_animated_value_clear(handle: *mut c_void);
    pub fn mdl_animated_value_set_interpolation(handle: *mut c_void, raw_value: u32);
    pub fn mdl_animated_scalar_new(
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_scalar_set_float(handle: *mut c_void, value: f32, time: f64);
    pub fn mdl_animated_scalar_float_value(handle: *mut c_void, time: f64) -> f32;
    pub fn mdl_animated_vector2_new(
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_vector2_set_float2(handle: *mut c_void, x: f32, y: f32, time: f64);
    pub fn mdl_animated_vector2_copy_float2_value(
        handle: *mut c_void,
        time: f64,
        out_x: *mut f32,
        out_y: *mut f32,
    );
    pub fn mdl_animated_vector3_new(
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_vector3_set_float3(handle: *mut c_void, x: f32, y: f32, z: f32, time: f64);
    pub fn mdl_animated_vector3_copy_float3_value(
        handle: *mut c_void,
        time: f64,
        out_x: *mut f32,
        out_y: *mut f32,
        out_z: *mut f32,
    );
    pub fn mdl_animated_vector4_new(
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_vector4_set_float4(
        handle: *mut c_void,
        x: f32,
        y: f32,
        z: f32,
        w: f32,
        time: f64,
    );
    pub fn mdl_animated_vector4_copy_float4_value(
        handle: *mut c_void,
        time: f64,
        out_x: *mut f32,
        out_y: *mut f32,
        out_z: *mut f32,
        out_w: *mut f32,
    );
    pub fn mdl_animated_quaternion_new(
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_quaternion_set_float(
        handle: *mut c_void,
        x: f32,
        y: f32,
        z: f32,
        w: f32,
        time: f64,
    );
    pub fn mdl_animated_quaternion_copy_float_value(
        handle: *mut c_void,
        time: f64,
        out_values: *mut f32,
    );
    pub fn mdl_animated_matrix4x4_new(
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_matrix4x4_set_float(handle: *mut c_void, values: *const f32, time: f64);
    pub fn mdl_animated_matrix4x4_copy_float_value(
        handle: *mut c_void,
        time: f64,
        out_values: *mut f32,
    );
    pub fn mdl_animated_scalar_array_new(
        element_count: u64,
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_scalar_array_set_float(
        handle: *mut c_void,
        values: *const f32,
        count: u64,
        time: f64,
    );
    pub fn mdl_animated_scalar_array_copy_float_at_time(
        handle: *mut c_void,
        time: f64,
        out_values: *mut f32,
        capacity: u64,
    ) -> u64;
    pub fn mdl_animated_vector3_array_new(
        element_count: u64,
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_vector3_array_set_float(
        handle: *mut c_void,
        values: *const f32,
        count: u64,
        time: f64,
    );
    pub fn mdl_animated_vector3_array_copy_float_at_time(
        handle: *mut c_void,
        time: f64,
        out_values: *mut f32,
        capacity_elements: u64,
    ) -> u64;
    pub fn mdl_animated_quaternion_array_new(
        element_count: u64,
        out_value: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animated_quaternion_array_set_float(
        handle: *mut c_void,
        values: *const f32,
        count: u64,
        time: f64,
    );
    pub fn mdl_animated_quaternion_array_copy_float_at_time(
        handle: *mut c_void,
        time: f64,
        out_values: *mut f32,
        capacity_elements: u64,
    ) -> u64;

    pub fn mdl_packed_joint_animation_new(
        name: *const c_char,
        joint_paths: *const *const c_char,
        joint_path_count: u64,
        out_animation: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_packed_joint_animation_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_packed_joint_animation_translations(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_packed_joint_animation_rotations(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_packed_joint_animation_scales(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_animation_bind_component_new(
        out_component: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_animation_bind_component_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_animation_bind_component_set_skeleton(handle: *mut c_void, skeleton: *mut c_void);
    pub fn mdl_animation_bind_component_skeleton(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_animation_bind_component_set_packed_joint_animation(
        handle: *mut c_void,
        animation: *mut c_void,
    );
    pub fn mdl_animation_bind_component_packed_joint_animation(handle: *mut c_void) -> *mut c_void;
    pub fn mdl_animation_bind_component_set_joint_paths(
        handle: *mut c_void,
        joint_paths: *const *const c_char,
        joint_path_count: u64,
    );
    pub fn mdl_animation_bind_component_set_geometry_bind_transform(
        handle: *mut c_void,
        values: *const f32,
    );

    pub fn mdl_skeleton_new(
        name: *const c_char,
        joint_paths: *const *const c_char,
        joint_path_count: u64,
        out_skeleton: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_skeleton_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_skeleton_copy_joint_bind_transforms(
        handle: *mut c_void,
        out_values: *mut f32,
        capacity_matrices: u64,
    ) -> u64;
    pub fn mdl_skeleton_copy_joint_rest_transforms(
        handle: *mut c_void,
        out_values: *mut f32,
        capacity_matrices: u64,
    ) -> u64;

    pub fn mdl_vertex_attribute_new(
        name: *const c_char,
        format: u32,
        offset: u64,
        buffer_index: u64,
        out_attribute: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_vertex_attribute_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_vertex_attribute_set_name(handle: *mut c_void, name: *const c_char);
    pub fn mdl_vertex_attribute_set_format(handle: *mut c_void, raw_value: u32);
    pub fn mdl_vertex_attribute_set_offset(handle: *mut c_void, offset: u64);
    pub fn mdl_vertex_attribute_set_buffer_index(handle: *mut c_void, buffer_index: u64);
    pub fn mdl_vertex_attribute_set_time(handle: *mut c_void, time: f64);
    pub fn mdl_vertex_attribute_set_initialization_value(
        handle: *mut c_void,
        x: f32,
        y: f32,
        z: f32,
        w: f32,
    );
    pub fn mdl_vertex_descriptor_new_copy(
        handle: *mut c_void,
        out_descriptor: *mut *mut c_void,
        out_error_message: *mut *mut c_char,
    ) -> i32;
    pub fn mdl_vertex_descriptor_info_json(handle: *mut c_void) -> *mut c_char;
    pub fn mdl_vertex_descriptor_attribute_count(handle: *mut c_void) -> u64;
    pub fn mdl_vertex_descriptor_attribute_at(handle: *mut c_void, index: u64) -> *mut c_void;
    pub fn mdl_vertex_descriptor_attribute_named(
        handle: *mut c_void,
        name: *const c_char,
    ) -> *mut c_void;
    pub fn mdl_vertex_descriptor_reset(handle: *mut c_void);
    pub fn mdl_vertex_descriptor_set_packed_offsets(handle: *mut c_void);
    pub fn mdl_vertex_descriptor_set_packed_strides(handle: *mut c_void);
}

pub mod status {
    pub const OK: i32 = 0;
    pub const INVALID_ARGUMENT: i32 = -1;
    pub const NULL_RESULT: i32 = -2;
    pub const FRAMEWORK: i32 = -3;
}