-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModelIO.framework.h
4553 lines (3661 loc) · 176 KB
/
ModelIO.framework.h
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
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ========== ModelIO.framework/Headers/MDLSubmesh.h
/*!
@header MDLSubmesh.h
@framework ModelIO
@abstract Structures for describing renderable elements of a mesh
@copyright Copyright © 2015 Apple, Inc. All rights reserved.
*/
#import <ModelIO/MDLTypes.h>
#import <ModelIO/MDLMaterial.h>
#import <ModelIO/MDLMeshBuffer.h>
NS_ASSUME_NONNULL_BEGIN
@class MDLSubmesh;
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@interface MDLSubmeshTopology : NSObject
/*!
@method initWithSubmesh:
@abstract create a topology object corresponding to the topology in the submesh
*/
- (instancetype) initWithSubmesh:(MDLSubmesh*)submesh;
/*!
@property faceTopologyBuffer
@abstract A buffer of 8 bit unsigned integer values, where each entry corresponds
to the number of vertices making up a face.
@discussion A submesh containing two triangles, a four sided polygon, and a
line, would contain the data 3 3 4 2.
If geometryType is of a fixed type, such as triangles, the buffer
is optional, and will be created on demand if read.
Indices to the vertex buffer will be stored in the index buffer
correspondingly. In the example above, the indices would be stored
in order, three indices for the first triangle, followed by three
for the second, followed by four for the polygon, and finally two
indices for the line.
*/
@property (nonatomic, retain, nullable) id<MDLMeshBuffer> faceTopology;
/*!
@property faceCount
@abstract The number of faces encoded in faceTopologyBuffer
*/
@property (nonatomic) NSUInteger faceCount;
/*! A crease value at a vertex to be applied during subdivision. Vertex creases
A zero value is smooth, a one value is peaked. It is intended to be used
with an index buffer, where the index buffer entries are vertex indices.
The corresponding values in the corner sharpness attribute indicate the
corner sharpness of those vertices. The index buffer is sparse. If a mesh
has three sharp vertices, then the index buffer will have three entries.
Since the number of entries in this vertex buffer is likely to be different
than the number of entries in any other vertex buffer, it shouldn't be
interleaved with other data.
*/
@property (nonatomic, retain, nullable) id<MDLMeshBuffer> vertexCreaseIndices;
@property (nonatomic, retain, nullable) id<MDLMeshBuffer> vertexCreases;
/*!
@property vertexCreaseCount
@abstract The number of vertex creases encoded in vertexCreases
*/
@property (nonatomic) NSUInteger vertexCreaseCount;
/*! A crease value at an edge to be applied during subdivision. Edge creases
A zero value is smooth, a one value is peaked. It is intended to be used
with an index buffer, where the index buffer entries are edge index pairs.
Accordingly, there will be two index entries for each edge sharpness entry,
and the sharpness entry corresponds to the edge itself.
The corresponding values in the edge sharpness attribute indicate the
edge sharpness of those edges. The index buffer is sparse. If a mesh
has three sharp edges, then the index buffer will have six entries.
Since the number of entries in this vertex buffer is likely to be different
than the number of entries in any other vertex buffer, it shouldn't be
interleaved with other data.
*/
@property (nonatomic, retain, nullable) id<MDLMeshBuffer> edgeCreaseIndices;
@property (nonatomic, retain, nullable) id<MDLMeshBuffer> edgeCreases;
/*!
@property edgeCreaseCount
@abstract The number of edge creases encoded in edgeCreases
*/
@property (nonatomic) NSUInteger edgeCreaseCount;
/*! The hole attribute is a vertex attribute of single integer values where
each integer is an index of a face that is to be used as a hole. If there
are two holes in a mesh, then the vertex buffer will have two entries.
Since the number of entries in this vertex buffer is likely to be different
than the number of entries in any other vertex buffer, it shouldn't be
interleaved with other data.
*/
@property (nonatomic, retain, nullable) id<MDLMeshBuffer> holes;
/*!
@property holeCount
@abstract The number of holes encoded in holes
*/
@property (nonatomic) NSUInteger holeCount;
@end
/*!
@class MDLSubmesh
@abstract A drawable subset of an MDLMesh, with its own material
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@interface MDLSubmesh : NSObject<MDLNamed>
/*!
@method initWithName:indexBuffer:indexCount:indexType:geometryType:material:
@abstract Initialize submesh with all data necessary to make properties valid
*/
- (instancetype)initWithName:(NSString *)name
indexBuffer:(id<MDLMeshBuffer>)indexBuffer
indexCount:(NSUInteger)indexCount
indexType:(MDLIndexBitDepth)indexType
geometryType:(MDLGeometryType)geometryType
material:(nullable MDLMaterial *)material;
/*!
@method initWithIndexBuffer:indexCount:indexType:geometryType:material:
@abstract Initialize submesh with all data necessary to make properties valid
*/
- (instancetype)initWithIndexBuffer:(id<MDLMeshBuffer>)indexBuffer
indexCount:(NSUInteger)indexCount
indexType:(MDLIndexBitDepth)indexType
geometryType:(MDLGeometryType)geometryType
material:(nullable MDLMaterial *)material;
/*!
@method initWithIndexBuffer:indexCount:indexType:faceTopologyBuffer:geometryType:material:
@abstract Initialize submesh with all data necessary to make properties valid
@discussion The geometry type will typically be MDLGeometryTypeVariableTopology,
if other types are used the faceTopologyBuffer contents should
reflect that.
*/
- (instancetype)initWithName:(NSString *)name
indexBuffer:(id<MDLMeshBuffer>)indexBuffer
indexCount:(NSUInteger)indexCount
indexType:(MDLIndexBitDepth)indexType
geometryType:(MDLGeometryType)geometryType
material:(nullable MDLMaterial *)material
topology:(nullable MDLSubmeshTopology *)topology;
/*!
@method initWithMDLSubmesh:indexType:geometryType:
@abstract Initialize submesh using another submesh as input.
@discussion the resulting submesh will have a new index type if necessary.
If a conversion from the source submesh's geometry type to the requested
geometry type is possible, conversion will be performed. Otherwise nil will
be returned.
*/
- (nullable instancetype)initWithMDLSubmesh:(nonnull MDLSubmesh*)submesh
indexType:(MDLIndexBitDepth)indexType
geometryType:(MDLGeometryType)geometryType;
/*!
@property indexBuffer
@abstract Index data referencing vertex data in parent mesh
*/
@property (nonatomic, readonly, retain) id<MDLMeshBuffer> indexBuffer;
- (id<MDLMeshBuffer>)indexBufferAsIndexType:(MDLIndexBitDepth)indexType;
/*!
@property indexCount
@abstract Number of indices in the indexBuffer
*/
@property (nonatomic, readonly) NSUInteger indexCount;
/*!
@property indexType
@abstract Data type of indices in indexBuffer
@discussion Support 8, 16, and 32 bit unsigned integer values
*/
@property (nonatomic, readonly) MDLIndexBitDepth indexType;
/*!
@property geometryType
@abstract Type of primitive that vertices referenced by the indexBuffer are
assembled into
*/
@property (nonatomic, readonly) MDLGeometryType geometryType;
/*!
@property material
@abstract Material to apply when rendering this object
*/
@property (nonatomic, retain, nullable) MDLMaterial *material;
/*!
@property topology
@abstract Topology data structure for use with MDLGeometryTypeVariableTopology
@discussion ignored for geometry types other than MDLGeometryTypeVariableTopology.
A submesh of type MDLGeometryTypeVariableTopology with no topology
data is an empty submesh.
*/
@property (nonatomic, retain, nullable) MDLSubmeshTopology *topology;
/*!
@property name
@abstract Identifying name for this object
*/
@property (nonatomic, copy) NSString *name;
@end
NS_ASSUME_NONNULL_END
// ========== ModelIO.framework/Headers/MDLTransform.h
/*!
@header MDLTransform.h
@framework ModelIO
@abstract Time sampled transformation of elements in 3d assets
@copyright Copyright © 2015 Apple, Inc. All rights reserved.
*/
#import <ModelIO/MDLObject.h>
#import <ModelIO/MDLTypes.h>
#import <Foundation/Foundation.h>
#include <simd/simd.h>
NS_ASSUME_NONNULL_BEGIN
@class MDLObject;
/** MDLTransformComponent
@summary a container for a time sampled local transformation
@discussion Accessors to get the local transform and the global transform
for a particular MDLObject are provided.
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@protocol MDLTransformComponent <MDLComponent>
@required
/** The matrix, at minimumTime */
@property (nonatomic, assign) matrix_float4x4 matrix;
/** if YES, this transform is intended to be in global space, not parent space */
@property (nonatomic, assign) BOOL resetsTransform;
/** If no animation data is present, minimumTime and maximumTime will be zero */
@property (nonatomic, readonly) NSTimeInterval minimumTime;
@property (nonatomic, readonly) NSTimeInterval maximumTime;
/** An array of sample times for which a key has been stored
If no animation data is present, the array will contain a single value of zero */
@property (nonatomic, readonly, copy) NSArray<NSNumber*> *keyTimes;
@optional
- (void)setLocalTransform:(matrix_float4x4)transform forTime:(NSTimeInterval)time;
/**
Resets any timing information, and makes transform valid at all times
*/
- (void)setLocalTransform:(matrix_float4x4)transform;
/** Returns the transform governing this transformable at the specified time
in the transformable's parent's space.
If non-animated, all frame values will return the same result.
*/
- (matrix_float4x4)localTransformAtTime:(NSTimeInterval)time;
/** Returns the transform governing this transformable at the specified frame in
world space. If there is no parent, identity will be returned
*/
+ (matrix_float4x4)globalTransformWithObject:(MDLObject *)object atTime:(NSTimeInterval)time;
@end
/**
Concrete implementation of <MDLTransformComponent>.
For more complex transform components create a class that conforms to
<MDLTransformComponent>.
@discussion Setting any of scale, translation, or rotation individually will
set the matrix property, and clear any timing information.
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@interface MDLTransform : NSObject <NSCopying, MDLTransformComponent>
/*!
@method init
@discussion Initialize an MDLTransform's matrices with identity
*/
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithIdentity API_DEPRECATED_WITH_REPLACEMENT("init", macos(10.11, 10.13), ios(9.0, 11.0), tvos(9.0, 11.0));
- (instancetype)initWithTransformComponent:(id<MDLTransformComponent>)component;
- (instancetype)initWithTransformComponent:(id<MDLTransformComponent>)component
resetsTransform:(BOOL)resetsTransform;
/**
Initialization with a matrix assumes the matrix is an invertible, homogeneous
affine transform matrix. Retrieving transform components after initialization
with a non-affine matrix will yield those of the identity transform.
*/
- (instancetype)initWithMatrix:(matrix_float4x4)matrix;
- (instancetype)initWithMatrix:(matrix_float4x4)matrix resetsTransform:(BOOL)resetsTransform;
/**
Set all transform components to identity
*/
- (void)setIdentity;
- (vector_float3)translationAtTime:(NSTimeInterval)time;
- (vector_float3)rotationAtTime:(NSTimeInterval)time;
- (vector_float3)shearAtTime:(NSTimeInterval)time;
- (vector_float3)scaleAtTime:(NSTimeInterval)time;
- (void)setMatrix:(matrix_float4x4)matrix forTime:(NSTimeInterval)time API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0));
- (void)setTranslation:(vector_float3)translation forTime:(NSTimeInterval)time;
- (void)setRotation:(vector_float3)rotation forTime:(NSTimeInterval)time;
- (void)setShear:(vector_float3)shear forTime:(NSTimeInterval)time;
- (void)setScale:(vector_float3)scale forTime:(NSTimeInterval)time;
/**
Construct a right handed rotation matrix at the specified time
*/
- (matrix_float4x4)rotationMatrixAtTime:(NSTimeInterval)time;
/**
If these properties are read and animation data exists the earliest value is returned.
Otherwise, if there is no animation data, the value of the property is the same at all times and that value is returned.
If written, timing information for said property is removed. To retain or add timing information, use the set:forTime selectors instead.
*/
@property (nonatomic, readwrite) vector_float3 translation;
@property (nonatomic, readwrite) vector_float3 rotation; // Euler XYZ radians
@property (nonatomic, readwrite) vector_float3 shear;
@property (nonatomic, readwrite) vector_float3 scale;
@end
NS_ASSUME_NONNULL_END
// ========== ModelIO.framework/Headers/MDLAnimatedValueTypes.h
/*!
@header MDLAnimatedValueTypes.h
@framework ModelIO
@abstract Time sampled animated value types
@copyright Copyright © 2015 Apple, Inc. All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <ModelIO/MDLTypes.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, MDLAnimatedValueInterpolation) {
MDLAnimatedValueInterpolationConstant,
MDLAnimatedValueInterpolationLinear
};
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedValue : NSObject<NSCopying>
-(BOOL)isAnimated;
@property (nonatomic, readonly) MDLDataPrecision precision;
@property (nonatomic, readonly) NSUInteger timeSampleCount;
@property (nonatomic, readonly) NSTimeInterval minimumTime;
@property (nonatomic, readonly) NSTimeInterval maximumTime;
@property (nonatomic) MDLAnimatedValueInterpolation interpolation;
@property (nonatomic, readonly) NSArray<NSNumber *> *keyTimes;
-(void)clear;
-(NSUInteger)getTimes:(NSTimeInterval *)timesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
/// AUTO-GENERATED FROM CodeGenArray.h
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedScalarArray : MDLAnimatedValue
@property (nonatomic, readonly) NSUInteger elementCount;
-(id)initWithElementCount:(NSUInteger)arrayElementCount;
-(void)setFloatArray:(const float *)array count:(NSUInteger)count atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(void)setDoubleArray:(const double *)array count:(NSUInteger)count atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloatArray:(float *)array maxCount:(NSUInteger)maxCount atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDoubleArray:(double *)array maxCount:(NSUInteger)maxCount atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(void)resetWithFloatArray:(const float *)valuesArray count:(NSUInteger)valuesCount atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)timesCount NS_REFINED_FOR_SWIFT;
-(void)resetWithDoubleArray:(const double *)valuesArray count:(NSUInteger)valuesCount atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)timesCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloatArray:(float *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDoubleArray:(double *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedVector3Array : MDLAnimatedValue
@property (nonatomic, readonly) NSUInteger elementCount;
-(id)initWithElementCount:(NSUInteger)arrayElementCount;
-(void)setFloat3Array:(const vector_float3 *)array count:(NSUInteger)count atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(void)setDouble3Array:(const vector_double3 *)array count:(NSUInteger)count atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloat3Array:(vector_float3 *)array maxCount:(NSUInteger)maxCount atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDouble3Array:(vector_double3 *)array maxCount:(NSUInteger)maxCount atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(void)resetWithFloat3Array:(const vector_float3 *)valuesArray count:(NSUInteger)valuesCount atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)timesCount NS_REFINED_FOR_SWIFT;
-(void)resetWithDouble3Array:(const vector_double3 *)valuesArray count:(NSUInteger)valuesCount atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)timesCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloat3Array:(vector_float3 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDouble3Array:(vector_double3 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedQuaternionArray : MDLAnimatedValue
@property (nonatomic, readonly) NSUInteger elementCount;
-(id)initWithElementCount:(NSUInteger)arrayElementCount;
-(void)setFloatQuaternionArray:(const simd_quatf *)array count:(NSUInteger)count atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(void)setDoubleQuaternionArray:(const simd_quatd *)array count:(NSUInteger)count atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloatQuaternionArray:(simd_quatf *)array maxCount:(NSUInteger)maxCount atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDoubleQuaternionArray:(simd_quatd *)array maxCount:(NSUInteger)maxCount atTime:(NSTimeInterval)time NS_REFINED_FOR_SWIFT;
-(void)resetWithFloatQuaternionArray:(const simd_quatf *)valuesArray count:(NSUInteger)valuesCount atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)timesCount NS_REFINED_FOR_SWIFT;
-(void)resetWithDoubleQuaternionArray:(const simd_quatd *)valuesArray count:(NSUInteger)valuesCount atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)timesCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloatQuaternionArray:(simd_quatf *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDoubleQuaternionArray:(simd_quatd *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
/// AUTO-GENERATED FROM CodeGen.h
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedScalar : MDLAnimatedValue
-(void)setFloat:(float)value atTime:(NSTimeInterval)time;
-(void)setDouble:(double)value atTime:(NSTimeInterval)time;
-(float)floatAtTime:(NSTimeInterval)time;
-(double)doubleAtTime:(NSTimeInterval)time;
-(void)resetWithFloatArray:(const float *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(void)resetWithDoubleArray:(const double *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloatArray:(float *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDoubleArray:(double *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedVector2 : MDLAnimatedValue
-(void)setFloat2:(vector_float2)value atTime:(NSTimeInterval)time;
-(void)setDouble2:(vector_double2)value atTime:(NSTimeInterval)time;
-(vector_float2)float2AtTime:(NSTimeInterval)time;
-(vector_double2)double2AtTime:(NSTimeInterval)time;
-(void)resetWithFloat2Array:(const vector_float2 *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(void)resetWithDouble2Array:(const vector_double2 *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloat2Array:(vector_float2 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDouble2Array:(vector_double2 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedVector3 : MDLAnimatedValue
-(void)setFloat3:(vector_float3)value atTime:(NSTimeInterval)time;
-(void)setDouble3:(vector_double3)value atTime:(NSTimeInterval)time;
-(vector_float3)float3AtTime:(NSTimeInterval)time;
-(vector_double3)double3AtTime:(NSTimeInterval)time;
-(void)resetWithFloat3Array:(const vector_float3 *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(void)resetWithDouble3Array:(const vector_double3 *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloat3Array:(vector_float3 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDouble3Array:(vector_double3 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedVector4 : MDLAnimatedValue
-(void)setFloat4:(vector_float4)value atTime:(NSTimeInterval)time;
-(void)setDouble4:(vector_double4)value atTime:(NSTimeInterval)time;
-(vector_float4)float4AtTime:(NSTimeInterval)time;
-(vector_double4)double4AtTime:(NSTimeInterval)time;
-(void)resetWithFloat4Array:(const vector_float4 *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(void)resetWithDouble4Array:(const vector_double4 *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloat4Array:(vector_float4 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDouble4Array:(vector_double4 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0))
MDL_EXPORT
@interface MDLAnimatedQuaternion : MDLAnimatedValue
-(void)setFloatQuaternion:(simd_quatf)value atTime:(NSTimeInterval)time;
-(void)setDoubleQuaternion:(simd_quatd)value atTime:(NSTimeInterval)time;
-(simd_quatf)floatQuaternionAtTime:(NSTimeInterval)time;
-(simd_quatd)doubleQuaternionAtTime:(NSTimeInterval)time;
-(void)resetWithFloatQuaternionArray:(const simd_quatf *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(void)resetWithDoubleQuaternionArray:(const simd_quatd *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloatQuaternionArray:(simd_quatf *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDoubleQuaternionArray:(simd_quatd *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLAnimatedMatrix4x4 : MDLAnimatedValue
-(void)setFloat4x4:(matrix_float4x4)value atTime:(NSTimeInterval)time;
-(void)setDouble4x4:(matrix_double4x4)value atTime:(NSTimeInterval)time;
-(matrix_float4x4)float4x4AtTime:(NSTimeInterval)time;
-(matrix_double4x4)double4x4AtTime:(NSTimeInterval)time;
-(void)resetWithFloat4x4Array:(const matrix_float4x4 *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(void)resetWithDouble4x4Array:(const matrix_double4x4 *)valuesArray atTimes:(const NSTimeInterval *)timesArray count:(NSUInteger)count NS_REFINED_FOR_SWIFT;
-(NSUInteger)getFloat4x4Array:(matrix_float4x4 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
-(NSUInteger)getDouble4x4Array:(matrix_double4x4 *)valuesArray maxCount:(NSUInteger)maxCount NS_REFINED_FOR_SWIFT;
@end
NS_ASSUME_NONNULL_END
// ========== ModelIO.framework/Headers/MDLAssetResolver.h
/*!
@header MDLAssetResolver.h
@framework ModelIO
@abstract Structures for representing contents of 3d model files
@copyright Copyright © 2017 Apple, Inc. All rights reserved.
*/
#import <ModelIO/ModelIOExports.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
@protocol MDLAssetResolver <NSObject>
- (BOOL)canResolveAssetNamed:(NSString*)name;
- (NSURL*)resolveAssetNamed:(NSString*)name;
@end
@class MDLAsset;
/*!
@class MDLRelativeAssetResolver
@abstract The relative asset resolver searches for referenced files
by checking the location of the asset for sibling files
satisfying the requested name.
*/
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLRelativeAssetResolver : NSObject <MDLAssetResolver>
- (instancetype)initWithAsset:(MDLAsset*)asset;
@property (nonatomic, readwrite, weak) MDLAsset *asset;
@end
/*!
@class MDLPathAssetResolver
@abstract The path asset resolver searches for referenced files
by prepending path.
@discussion Path should resolve to a well formed URI. A file system
path might take the form @"file:///path/to/all/assets/
A trailing slash is automatically appended to path if
not provided.
*/
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLPathAssetResolver : NSObject <MDLAssetResolver>
- (instancetype)initWithPath:(NSString*)path;
@property (nonatomic, readwrite, copy) NSString *path;
@end
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLBundleAssetResolver : NSObject <MDLAssetResolver>
- (instancetype)initWithBundle:(NSString*)path;
@property (nonatomic, readwrite, copy) NSString *path;
@end
NS_ASSUME_NONNULL_END
// ========== ModelIO.framework/Headers/MDLMeshBuffer.h
/*!
@header MDLMeshBuffer.h
@framework ModelIO
@abstract Protocols for creating and backing mesh vertex and index buffers
@discussion Apps can use these protocols to back buffers with custom memory
types such as GPU or File based memory
@copyright Copyright © 2015 Apple, Inc. All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <ModelIO/ModelIOExports.h>
#import <ModelIO/MDLTypes.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@enum MDLMeshBufferType
@abstract Type of data a MDLMeshBuffer has been allocated for
*/
typedef NS_ENUM(NSUInteger, MDLMeshBufferType) {
MDLMeshBufferTypeVertex = 1,
MDLMeshBufferTypeIndex = 2,
};
@protocol MDLMeshBuffer;
@protocol MDLMeshBufferAllocator;
@protocol MDLMeshBufferZone;
/*!
@class MDLMeshBufferMap
@abstract Represents a reference to memory of a mapped MeshBuffer
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@interface MDLMeshBufferMap : NSObject
/*!
@method initWithBytes:deallocator:
@abstract Called by implementor of MDLMeshBuffer protocol to create the map
and arrange for unmapping on deallocation.
*/
-(instancetype) initWithBytes:(void*)bytes
deallocator:(nullable void (^)(void))deallocator;
/*!
@property bytes
@abstract Mutable pointer to data in a MDLMeshBuffer object.
*/
@property (nonatomic, readonly) void *bytes;
@end
/*!
@protocol MDLMeshBuffer
@abstract Used by ModelIO to represent a buffer to be filled with vertex and
index data
@discussion Supports deep copy of data by conforming to the NSCopying protocol
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
@protocol MDLMeshBuffer <NSObject, NSCopying>
/*!
@method fillData:offset:
@abstract Fills buffer with data at offset
@param data Data to fill buffer with
@param offset Byte offset in buffer to begin filling data
@discussion Fills data.length bytes of data. Will not write beyond length of
this buffer.
*/
- (void)fillData:(NSData *)data offset:(NSUInteger)offset;
/*!
@method map
@abstract CPU access to buffer's memory
@return An MDLMeshBufferMap object to read or modify a buffer's memory
@discussion The buffer will remain mapped as long as the returned MDLMeshBufferMap
object exists. Mapping a buffer may impose restrictions on a system.
For instance, if the implementing class maps an OpenGL buffer, that
buffer may be unavailable for rendering while mapped, and cause a
draw failure. Precautions must be taken in such cases.
*/
- (MDLMeshBufferMap *)map;
/*!
@property length
@abstract Size in bytes of the buffer allocation
*/
@property (nonatomic, readonly) NSUInteger length;
/*!
@property allocator
@abstract Allocator object used to create this buffer.
@discussion This allcoator used for copy and relayout operations (such as when
a new vertex descriptor is applied to a vertex buffer)
*/
@property (nonatomic, readonly, retain) id<MDLMeshBufferAllocator> allocator;
/*!
@property zone
@abstract Zone from which this buffer was created
@discussion This zone will be used for copy and relayout operations (such as
when a new vertex descriptor is applied to a vertex buffer). If
the default zone is used this will be nil.
*/
@property (nonatomic, readonly, retain) id<MDLMeshBufferZone> zone;
/*!
@property type
@abstract the intended type of the buffer
*/
@property (nonatomic, readonly) MDLMeshBufferType type;
@end
/*!
@class MDLMeshBufferData
@abstract A CPU memory backed mesh buffer
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@interface MDLMeshBufferData : NSObject <MDLMeshBuffer>
/*!
@method initWithType:length
@abstract instantiate a new data backed mesh buffer
@param type the intended use of the buffer
@param length the size of buffer to allocate, in bytes
*/
- (instancetype)initWithType:(MDLMeshBufferType)type length:(NSUInteger)length;
/*!
@method initWithType:data
@abstract instantiate a new data backed mesh buffer
@param type the intended use of the buffer
@param data the data to be used as a mesh buffer. It will be copied.
*/
- (instancetype)initWithType:(MDLMeshBufferType)type data:(nullable NSData*)data;
@property (nonatomic, readonly, retain) NSData *data;
@end
/*!
@protocol MDLMeshBufferZone
@abstract A reference to a logical pool of memory from which mesh buffers would
be allocated
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
@protocol MDLMeshBufferZone <NSObject>
/*!
@property capacity
@abstract Total size of memory in the zone
*/
@property (nonatomic, readonly) NSUInteger capacity;
/*!
@property allocator
@abstract Allocator used to create the zone
*/
@property (nonatomic, readonly) id<MDLMeshBufferAllocator> allocator;
@end
/*!
@protocol MDLMeshBufferAllocator
@abstract Object for allocating buffers to back vertex and index data
@discussion Accepted by MDLAsset init method. Implementor creates objects
implementing MDLMeshBuffer with memory to be filled with vertex and
index data during 3d file loading and parsing.
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
@protocol MDLMeshBufferAllocator <NSObject>
/*!
@method newZone:
@abstract Create a zone which can be used to allocate MDLMeshBuffer objects
@param capacity Total size in bytes of all buffers which can be created from
this zone
*/
-(id<MDLMeshBufferZone>)newZone:(NSUInteger)capacity;
/*!
@method newZoneForBuffersWithSize:andType:
@abstract Create a zone which can be used to allocate MDLMeshBuffer objects
@param sizes Sizes of each buffer to be created in this zone
@param types Type of each buffer to be created in this zone. Values to be of
MDLMeshBufferType
@discussion Will create a zone from which MDLMeshBuffer objects can be
allocated. This will allocate a zone with enough capacity
for each of the buffers with sizes and types specified even taking
into any alignment restrictions necessary to use these buffers.
*/
-(id<MDLMeshBufferZone>)newZoneForBuffersWithSize:(NSArray<NSNumber*>*)sizes
andType:(NSArray<NSNumber*>*)types;
/*!
@method newBuffer:type:
@abstract Create a buffer in a default zone
@param length Size of buffer to be created in bytes
@param type Type of data to be stored in this buffer
*/
-(id<MDLMeshBuffer>)newBuffer:(NSUInteger)length
type:(MDLMeshBufferType)type;
/*!
@method newBufferWithData:type:
@abstract Create a buffer in a default zone and fill with data in the supplied
NSData object
@param data Memory to fill the buffer with
@param type Type of data to be stored in this buffer
*/
-(id<MDLMeshBuffer>)newBufferWithData:(NSData *)data
type:(MDLMeshBufferType)type;
/*!
@method newBufferFromZone:length:type:
@abstract Create a buffer from a given zone with the given length
@return An object conforming to the MDLMeshBuffer protocol. Returns nil the
buffer could not be allocated in the zone given.
@param zone Zone from which to allocate the memory
@param type Type of data to be stored in this buffer
@discussion An implementing MDLMeshBufferAllocator object may increase the size
of the zone if the buffer could not be allocated with the current
zone size. Alternatively the implementation may return nil if the
buffer could not be allocated.
*/
-(nullable id<MDLMeshBuffer>)newBufferFromZone:(nullable id<MDLMeshBufferZone>)zone
length:(NSUInteger)length
type:(MDLMeshBufferType)type;
/*!
@method newBufferFromZone:data:type:
@abstract Create a buffer from a given zone and fill with data in the supplied
NSData object
@return An object conforming to the MDLMeshBuffer protocol. Returns nil the
buffer could not be allocated in the given zone
@param zone Zone from which to allocate the memory
@param data Values with which to fill the buffer
@param type Type of data to be stored in this buffer
@discussion An implementing MDLMeshBufferAllocator object may increase the size
of the zone if the buffer could not be allocated with the current
zone size. Alternatively the implementation may return nil if the
buffer could not be allocated.
*/
-(nullable id<MDLMeshBuffer>)newBufferFromZone:(nullable id<MDLMeshBufferZone>)zone
data:(NSData *)data
type:(MDLMeshBufferType)type;
@end
/*!
An allocator to use when backing with an NSData is appropriate.
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@interface MDLMeshBufferDataAllocator: NSObject <MDLMeshBufferAllocator>
@end
/*!
A default zone that can be use for convenience
*/
API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0))
MDL_EXPORT
@interface MDLMeshBufferZoneDefault : NSObject <MDLMeshBufferZone>
@property (nonatomic, readonly) NSUInteger capacity;
@property (nonatomic, readonly, retain) id<MDLMeshBufferAllocator> allocator;
@end
NS_ASSUME_NONNULL_END
// ========== ModelIO.framework/Headers/MDLMesh.h
/*!
@header MDLMesh.h
@framework ModelIO
@abstract Structures for describing meshes for rendering
@copyright Copyright © 2015 Apple, Inc. All rights reserved.
*/
#import <ModelIO/MDLTypes.h>
#import <ModelIO/MDLLight.h>
#import <ModelIO/MDLTransform.h>
#import <ModelIO/MDLSubmesh.h>
#import <ModelIO/MDLMeshBuffer.h>
#import <ModelIO/MDLVertexDescriptor.h>
NS_ASSUME_NONNULL_BEGIN
/*!
@class MDLVertexAttributeData
@abstract convenience object to quickly access vertex attribute data
@discussion created by MDLMesh's vertexAttributeData selector
Setting values on this object has no effect on the
underlying objects.
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@interface MDLVertexAttributeData : NSObject
@property (nonatomic, retain) MDLMeshBufferMap *map;
@property (nonatomic) void *dataStart;
@property (nonatomic) NSUInteger stride;
@property (nonatomic) MDLVertexFormat format;
@property (nonatomic) NSUInteger bufferSize API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0));
@end
/*!
@class MDLMesh
@abstract A vertex buffer with info to interpret vertex data
@discussion Includes a collection of submeshs which have indexbuffer and
material information
*/
API_AVAILABLE(macos(10.11), ios(9.0), tvos(9.0))
MDL_EXPORT
@interface MDLMesh : MDLObject
/*!
@method initWithAllocator:
@abstract Initialize a mesh with an allocator
@return An empty mesh
*/
- (instancetype)initWithBufferAllocator:(nullable id<MDLMeshBufferAllocator>)bufferAllocator;
/*!
@method initWithVertexBuffer:vertexCount:descriptor:submeshes:
@abstract Initialize object with a vertex buffer and a collection of submeshes
@return Initialized mesh or nil if descriptor's layout array does not describe
a single buffer
@param vertexBuffer MDLMeshBuffer object containing all vertex data for the mesh
@param vertexCount Number of vertices in the vertexBuffer
@param descriptor VertexDescriptor specifying how to interpret vertex data
@param submeshes Array of submeshes with index buffers referencing vertex data
and/or materials to be applied to mesh
*/
- (instancetype)initWithVertexBuffer:(id<MDLMeshBuffer>)vertexBuffer