-
Notifications
You must be signed in to change notification settings - Fork 0
/
SceneKit.framework.h
8820 lines (7069 loc) · 369 KB
/
SceneKit.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
// ========== SceneKit.framework/Headers/SCNPhysicsWorld.h
//
// SCNPhysicsWorld.h
// SceneKit
//
// Copyright © 2014-2019 Apple Inc. All rights reserved.
//
#import <SceneKit/SceneKitTypes.h>
NS_ASSUME_NONNULL_BEGIN
@class SCNPhysicsBody;
@class SCNPhysicsShape;
@class SCNPhysicsWorld;
@class SCNPhysicsContact;
@class SCNPhysicsBehavior;
@class SCNHitTestResult;
// Keys for ray, contact and sweep tests
typedef NSString * SCNPhysicsTestOption NS_STRING_ENUM;
SCN_EXPORT SCNPhysicsTestOption const SCNPhysicsTestCollisionBitMaskKey API_AVAILABLE(macos(10.10)); // Allows to filter the objects tested by rayTest, contactTest and convexSweep. Default is SCNPhysicsCollisionCategoryAll
SCN_EXPORT SCNPhysicsTestOption const SCNPhysicsTestSearchModeKey API_AVAILABLE(macos(10.10)); // Specifies how to perform the ray/contact/sweep test. Values are defined below. If not defined, then defaults to SCNPhysicsTestSearchModeAny
SCN_EXPORT SCNPhysicsTestOption const SCNPhysicsTestBackfaceCullingKey API_AVAILABLE(macos(10.10)); // Specifies whether the back faces should be ignored or not. Defaults to YES.
#define SCNPhysicsTestOptionCollisionBitMask SCNPhysicsTestCollisionBitMaskKey
#define SCNPhysicsTestOptionSearchMode SCNPhysicsTestSearchModeKey
#define SCNPhysicsTestOptionBackfaceCulling SCNPhysicsTestBackfaceCullingKey
// Values for SCNPhysicsTestSearchModeKey
typedef NSString * SCNPhysicsTestSearchMode NS_STRING_ENUM;
SCN_EXPORT SCNPhysicsTestSearchMode const SCNPhysicsTestSearchModeAny API_AVAILABLE(macos(10.10)); // Returns the first contact found.
SCN_EXPORT SCNPhysicsTestSearchMode const SCNPhysicsTestSearchModeClosest API_AVAILABLE(macos(10.10)); // Returns the nearest contact found only.
SCN_EXPORT SCNPhysicsTestSearchMode const SCNPhysicsTestSearchModeAll API_AVAILABLE(macos(10.10)); // All contacts are returned.
/*!
@protocol SCNPhysicsContactDelegate
@abstract The SCNPhysicsContactDelegate protocol is to be implemented by delegates that want to be notified when a contact occured.
*/
API_AVAILABLE(macos(10.10))
@protocol SCNPhysicsContactDelegate <NSObject>
@optional
- (void)physicsWorld:(SCNPhysicsWorld *)world didBeginContact:(SCNPhysicsContact *)contact;
- (void)physicsWorld:(SCNPhysicsWorld *)world didUpdateContact:(SCNPhysicsContact *)contact;
- (void)physicsWorld:(SCNPhysicsWorld *)world didEndContact:(SCNPhysicsContact *)contact;
@end
/*!
@class SCNPhysicsWorld
@abstract The SCNPhysicsWorld class describes and allows to control the physics simulation of a 3d scene.
@discussion The SCNPhysicsWorld class should not be allocated directly but retrieved from the SCNScene class using the physicsWorld property.
*/
SCN_EXPORT API_AVAILABLE(macos(10.10))
@interface SCNPhysicsWorld : NSObject <NSSecureCoding>
//A global 3D vector specifying the field force acceleration due to gravity. The unit is meter per second. Default is {0, -9.8, 0}.
@property(nonatomic) SCNVector3 gravity;
//A speed multiplier applied to the physics simulation. Default is 1.0.
//The speed can be reduced to slowdown the simulation, but beware that increasing the speed factor will decrease the accuracy of the simulation.
@property(nonatomic) CGFloat speed;
//The time step of the physics simulation. Default is 1/60s (60 Hz).
@property(nonatomic) NSTimeInterval timeStep;
//A delegate that is called when two physic bodies come in contact with each other.
//On iOS 11 or lower the property is unsafe_unretained and it's the responsibility of the client to set it to nil before deallocating the delegate.
//Starting in iOS12, the property is weak
@property(atomic, weak, nullable) id <SCNPhysicsContactDelegate> contactDelegate;
//Behaviors management
- (void)addBehavior:(SCNPhysicsBehavior *)behavior;
- (void)removeBehavior:(SCNPhysicsBehavior *)behavior;
- (void)removeAllBehaviors;
@property(nonatomic, readonly) NSArray<SCNPhysicsBehavior *> *allBehaviors;
//Performs a ray test on the physics bodies and their physics shapes.
- (NSArray<SCNHitTestResult *> *)rayTestWithSegmentFromPoint:(SCNVector3)origin toPoint:(SCNVector3)dest options:(nullable NSDictionary<SCNPhysicsTestOption, id> *)options;
//The methods below perform contact tests.
- (NSArray<SCNPhysicsContact *> *)contactTestBetweenBody:(SCNPhysicsBody *)bodyA andBody:(SCNPhysicsBody *)bodyB options:(nullable NSDictionary<SCNPhysicsTestOption, id> *)options;
- (NSArray<SCNPhysicsContact *> *)contactTestWithBody:(SCNPhysicsBody *)body options:(nullable NSDictionary<SCNPhysicsTestOption, id> *)options;
- (NSArray<SCNPhysicsContact *> *)convexSweepTestWithShape:(SCNPhysicsShape *)shape fromTransform:(SCNMatrix4)from toTransform:(SCNMatrix4)to options:(nullable NSDictionary<SCNPhysicsTestOption, id> *)options;
//Force the physics engine to re-evaluate collisions.
//This needs to be called if kinematic are moved and the contacts are wanted before the next simulation step.
- (void)updateCollisionPairs;
@end
NS_ASSUME_NONNULL_END
// ========== SceneKit.framework/Headers/SCNParticleSystem.h
//
// SCNParticleSystem.h
// SceneKit
//
// Copyright © 2014-2019 Apple Inc. All rights reserved.
//
#import <SceneKit/SceneKitTypes.h>
#import <SceneKit/SCNNode.h>
#import <SceneKit/SCNScene.h>
NS_ASSUME_NONNULL_BEGIN
@class UIColor;
@class SCNGeometry;
typedef NSString * SCNParticleProperty NS_STRING_ENUM;
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyPosition API_AVAILABLE(macos(10.10)); // float3 : {x,y,z} controller animation type : {NSValue(SCNVector3)}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyAngle API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyRotationAxis API_AVAILABLE(macos(10.10)); // float3 : {x,y,z} controller animation type : {NSValue(SCNVector3)}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyVelocity API_AVAILABLE(macos(10.10)); // float3 : {x,y,z} controller animation type : {NSValue(SCNVector3)}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyAngularVelocity API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyLife API_AVAILABLE(macos(10.10)); // float not controllable
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyColor API_AVAILABLE(macos(10.10)); // float4 : {r,g,b,a} controller animation type : {UIColor}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyOpacity API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertySize API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyFrame API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyFrameRate API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyBounce API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyCharge API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyFriction API_AVAILABLE(macos(10.10)); // float controller animation type : {NSNumber}
// These two properties are only available when handling the events of type SCNParticleEventCollision.
// They are read-only values.
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyContactPoint API_AVAILABLE(macos(10.10)); // float3 not controllable
SCN_EXPORT SCNParticleProperty const SCNParticlePropertyContactNormal API_AVAILABLE(macos(10.10)); // float3 not controllable
/*!
@typedef SCNParticleEventBlock
@param data array of particle properties data stripes, ordered by the given NSArray of properties name in [- handleEvent:forProperties:withBlock:]
@param dataStride array of particle properties data stripes stride, with the same ordering than data.
@param indices optional array of count indices referencing the particles affected by the event. Only SCNParticleEventDeath and SCNParticleEventCollision provide this array. For SCNParticleEventBirth the indices are implicitely [0,1,2,..,count-1]
@param count number of particles affected by the event
@discussion This is a small example of usage of an event handling:
[particleSystem handleEvent:SCNParticleEventCollision forProperties:@[SCNParticlePropertyAngle, SCNParticlePropertyRotationAxis, SCNParticlePropertyContactNormal] withBlock:^(void **data, size_t *dataStride, uint32_t *indices, NSInteger count) {
for (NSInteger i = 0; i < count; ++i) {
// SCNParticlePropertyAngle (float)
float *angle = (float *)((char *)data[0] + dataStride[0] * indices[i]);
// SCNParticlePropertyRotationAxis (float3)
float *axis = (float *)((char *)data[1] + dataStride[1] * indices[i]);
// SCNParticlePropertyContactNormal (float3)
float *colNrm = (float *)((char *)data[2] + dataStride[2] * indices[i]);
// rotate the particle (angle[0] and axis[0..2] based on the collision normal (colNrm[0..2])
// ...
}
}];
*/
typedef void (^SCNParticleEventBlock)(void * _Nonnull * _Nonnull data, size_t * _Nonnull dataStride, uint32_t * _Nullable indices, NSInteger count);
/*!
@typedef SCNParticleModifierBlock
@param data array of particle properties data stripes, ordered by the given NSArray of properties name in [- handleEvent:forProperties:withBlock:]
@param dataStride array of particle properties data stripes stride, with the same ordering than data.
@param start index of the first particle
@param end index of the last particle
@param deltaTime duration of the simulation step, in seconds.
@discussion This is a small example of usage of a modifier block:
[self.particleSystem addModifierForProperties:@[SCNParticlePropertyPosition, SCNParticlePropertyVelocity] atStage:SCNParticleModifierStagePreCollision withBlock:^(void **data, size_t *dataStride, NSInteger start, NSInteger end, float deltaTime) {
for (NSInteger i = start; i < end; ++i) {
// SCNParticlePropertyPosition (float3)
float *pos = (float *)((char *)data[0] + dataStride[0] * i);
// SCNParticlePropertyVelocity (float3)
float *vel = (float *)((char *)data[1] + dataStride[1] * i);
// change velocity and/or position
// ...
}
}];
*/
typedef void (^SCNParticleModifierBlock)(void * _Nonnull * _Nonnull data, size_t * _Nonnull dataStride, NSInteger start, NSInteger end, float deltaTime);
// Particle Sorting Mode
typedef NS_ENUM(NSInteger, SCNParticleSortingMode) {
SCNParticleSortingModeNone, //particles are not sorted
SCNParticleSortingModeProjectedDepth, //particles are sorted by depth (far rendered first)
SCNParticleSortingModeDistance, //particles are sorted by distance from the point of view
SCNParticleSortingModeOldestFirst, //particles are sorted by birth date - oldest first
SCNParticleSortingModeYoungestFirst //particles are sorted by birth date - yougest first
} API_AVAILABLE(macos(10.10));
// Particle Blend Mode
typedef NS_ENUM(NSInteger, SCNParticleBlendMode) {
SCNParticleBlendModeAdditive,
SCNParticleBlendModeSubtract,
SCNParticleBlendModeMultiply,
SCNParticleBlendModeScreen,
SCNParticleBlendModeAlpha,
SCNParticleBlendModeReplace
} API_AVAILABLE(macos(10.10));
// Particle Orientation Mode
typedef NS_ENUM(NSInteger, SCNParticleOrientationMode) {
SCNParticleOrientationModeBillboardScreenAligned, // particles are aligned on screen
SCNParticleOrientationModeBillboardViewAligned, // particles are perpendicular with the vector from the point of view to the particle.
SCNParticleOrientationModeFree, // free on all axis.
SCNParticleOrientationModeBillboardYAligned // fixed on Y axis.
} API_AVAILABLE(macos(10.10));
// Particle Birth Location
typedef NS_ENUM(NSInteger, SCNParticleBirthLocation) {
SCNParticleBirthLocationSurface, //particles are emitted on the surface of the emitter shape.
SCNParticleBirthLocationVolume, //particles are emitted inside the volume of the emitter shape.
SCNParticleBirthLocationVertex //particles are emitted on the vertices of the emitter shape.
} API_AVAILABLE(macos(10.10));
// Particle Birth Direction
typedef NS_ENUM(NSInteger, SCNParticleBirthDirection) {
SCNParticleBirthDirectionConstant, // Z Direction of the Emitter.
SCNParticleBirthDirectionSurfaceNormal, // Use the direction induced by the shape
SCNParticleBirthDirectionRandom // Random direction.
} API_AVAILABLE(macos(10.10));
// Texture Animation Mode
typedef NS_ENUM(NSInteger, SCNParticleImageSequenceAnimationMode) {
SCNParticleImageSequenceAnimationModeRepeat, // The animation will loop.
SCNParticleImageSequenceAnimationModeClamp, // The animation will stop at both ends.
SCNParticleImageSequenceAnimationModeAutoReverse // The animation will reverse when reaching an end.
} API_AVAILABLE(macos(10.10));
// Particle Variation Mode
typedef NS_ENUM(NSInteger, SCNParticleInputMode) {
SCNParticleInputModeOverLife, // The input time for the controller animation is the current life duration of the particle
SCNParticleInputModeOverDistance, // The input time for the controller animation is the distance from the variation origin node.
SCNParticleInputModeOverOtherProperty, // The input time for the controller animation is the current value of another specified property.
} API_AVAILABLE(macos(10.10));
// Particle Modifier Stage
typedef NS_ENUM(NSInteger, SCNParticleModifierStage) {
SCNParticleModifierStagePreDynamics,
SCNParticleModifierStagePostDynamics,
SCNParticleModifierStagePreCollision,
SCNParticleModifierStagePostCollision
} API_AVAILABLE(macos(10.10));
// Particle Event
typedef NS_ENUM(NSInteger, SCNParticleEvent) {
SCNParticleEventBirth, // Event triggered when a new particle spawns.
SCNParticleEventDeath, // Event triggered when a particle dies.
SCNParticleEventCollision // Event triggered when a particle collides with a collider node.
} API_AVAILABLE(macos(10.10));
/*!
@class SCNParticlePropertyController
@abstract The SCNParticlePropertyController class controls the variation over time or over distance of a particle property.
*/
SCN_EXPORT API_AVAILABLE(macos(10.10))
@interface SCNParticlePropertyController: NSObject <NSSecureCoding, NSCopying>
// Creates and initializes a particle property controller with the specified animation.
+ (instancetype)controllerWithAnimation:(CAAnimation *)animation API_UNAVAILABLE(watchos);
// Specifies the animation to be applied on the particle system property. The type of the animation will depend of the property controlled.
// See the documentation along property name definition.
@property(nonatomic, retain) CAAnimation *animation API_UNAVAILABLE(watchos);
// Specify the input mode of the receiver.
// This can be over life, over distance or over the evolution of another proprety.
// Defaults to SCNParticleInputModeOverLife.
@property(nonatomic) SCNParticleInputMode inputMode;
// Specifies the input scale and bias.
// inputScale defaults to 1 and inputBias to 0.
@property(nonatomic) CGFloat inputScale;
@property(nonatomic) CGFloat inputBias;
// Specifies an origin for the variation mode "SCNParticleInputModeOverDistance".
@property(nonatomic, unsafe_unretained, nullable) SCNNode *inputOrigin;
// Specifies which property to use as input for the input mode "SCNParticleInputModeOverOtherProperty".
@property(nonatomic, copy, nullable) SCNParticleProperty inputProperty;
@end
/*!
@class SCNParticleSystem
@abstract The SCNParticleSystem class represents a system of particles.
*/
SCN_EXPORT API_AVAILABLE(macos(10.10))
@interface SCNParticleSystem : NSObject <NSCopying, NSSecureCoding, SCNAnimatable>
// Create an instance of a particle system
+ (instancetype)particleSystem;
+ (nullable instancetype)particleSystemNamed:(NSString *)name inDirectory:(nullable NSString *)directory;
#pragma mark Emitter properties
// Specifies the duration of the emission. Defaults to 1. Animatable.
@property(nonatomic) CGFloat emissionDuration;
// Specifies the variation of the emission duration. Defaults to 0. Animatable.
@property(nonatomic) CGFloat emissionDurationVariation;
// Specifies the idle duration between two emissions. Defaults to 0. Animatable.
@property(nonatomic) CGFloat idleDuration;
// Specifies the variation of the idle duration. Defaults to 0. Animatable.
@property(nonatomic) CGFloat idleDurationVariation;
// Specifies the looping behavior of the emission. Defaults to YES.
@property(nonatomic) BOOL loops;
// Specifies the particle rate flow, in particles per emissionDuration.
// An emissionDuration of 0 without looping means that the particles are emitted instantaneously
// 0 means that the emitter emits nothing, unless it has variation. Defaults to 1. Animatable.
@property(nonatomic) CGFloat birthRate;
// Specifies the variation of the rate flow. Defaults to 0. Animatable.
@property(nonatomic) CGFloat birthRateVariation;
// Specifies the time length during which particles are emit before the first rendering of the system.
// For example this allows to start a scene with snow that already has fallen. Defaults to 0. Animatable.
@property(nonatomic) CGFloat warmupDuration;
// Specifies the shape of the emitter. nil means a punctual emitter. Defaults to nil.
@property(nonatomic, retain, nullable) SCNGeometry *emitterShape;
// Specifies the location of newly created particles. Defaults to SCNParticleBirthLocationSurface.
@property(nonatomic) SCNParticleBirthLocation birthLocation;
// Specifies the direction of newly created particles. Defaults to SCNParticleBirthDirectionConstant.
@property(nonatomic) SCNParticleBirthDirection birthDirection;
// Specifies the spreading direction of newly created particles, in degrees. Not used in SCNParticleBirthDirectionRandom. Defaults to 0. Animatable.
@property(nonatomic) CGFloat spreadingAngle;
// Specifies the emitting direction of newly created particles, used in the SCNParticleBirthDirectionConstant mode. Defaults to {0, 0, 1}. Animatable.
@property(nonatomic) SCNVector3 emittingDirection;
// Specifies the orientation direction of newly created particles, used in the SCNParticleOrientationModeFree mode. The particle will rotate around this axis. Defaults to {0, 0, 0}, which means random. The particle will then rotate arbitraly. Animatable.
@property(nonatomic) SCNVector3 orientationDirection API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
// Specifies the acceleration applied to particles, in world coordinates.
// Allows to simulate winds or gravity. Defaults to {0, 0, 0}. Animatable.
@property(nonatomic) SCNVector3 acceleration;
// Specifies the rendering and simulation type of the system.
// If set to YES, the system is rendered with the transform of the attached node. Defaults to NO.
@property(nonatomic, getter=isLocal) BOOL local;
#pragma mark Particle properties
// Specifies the initial angle of the particles at birth, in degrees. Defaults to 0. Animatable.
@property(nonatomic) CGFloat particleAngle;
// Specifies the variation of the initial angle of the particles at birth, in degrees. Defaults to 0. Animatable.
@property(nonatomic) CGFloat particleAngleVariation;
// Specifies the initial velocity of the particles at birth,
// in units per second. Defaults to 0. Animatable.
@property(nonatomic) CGFloat particleVelocity;
// Specifies the variation of the velocity. Defaults to 0. Animatable.
@property(nonatomic) CGFloat particleVelocityVariation;
// Specifies the initial angular velocity of the particles at birth,
// in degrees per second. Defaults to 0. Animatable.
@property(nonatomic) CGFloat particleAngularVelocity;
// Specifies the variation of the angular velocity, in degrees per second. Defaults to 0. Animatable.
@property(nonatomic) CGFloat particleAngularVelocityVariation;
// Specifies the life span of particles. Animatable.
@property(nonatomic) CGFloat particleLifeSpan;
// Specifies the life span variation of particles. Animatable.
@property(nonatomic) CGFloat particleLifeSpanVariation;
// Specifies an optional system to spawn new particles when a particle dies
@property(nonatomic, retain, nullable) SCNParticleSystem *systemSpawnedOnDying;
// Specifies an optional system to spawn new particles when a particle dies
@property(nonatomic, retain, nullable) SCNParticleSystem *systemSpawnedOnCollision;
// Specifies an optional system to spawn new particles when a particle is alive
@property(nonatomic, retain, nullable) SCNParticleSystem *systemSpawnedOnLiving;
#pragma mark Particle Rendering
// Specifies the image of the particle.
// Can be set to an NSImage/UIImage, a path or a URL.
@property(nonatomic, retain, nullable) id particleImage;
// Specifies the number of column in the image sequence. Defaults to 1.
@property(nonatomic) NSUInteger imageSequenceColumnCount;
// Specifies the number of row in the image sequence. Defaults to 1
@property(nonatomic) NSUInteger imageSequenceRowCount;
// Specifies the texture initial frame index. Ranges from 0 to (imageSequenceColumnCount * imageSequenceRowCount - 1). Defaults to 0. Animatable.
@property(nonatomic) CGFloat imageSequenceInitialFrame;
// Specifies the texture initial frame variation. Animatable.
@property(nonatomic) CGFloat imageSequenceInitialFrameVariation;
// Specifies the texture animation frame rate, in frames per second. Defaults to 0. Animatable.
@property(nonatomic) CGFloat imageSequenceFrameRate;
// Specifies the texture animation frame rate variation, in frames per second. Defaults to 0. Animatable.
@property(nonatomic) CGFloat imageSequenceFrameRateVariation;
// Specifies the texture animation mode. Defaults to SCNTextureAnimationModeRepeat.
@property(nonatomic) SCNParticleImageSequenceAnimationMode imageSequenceAnimationMode;
// Specifies the initial color of the particle. Animatable. Defaults to opaque white.
@property(nonatomic, retain) UIColor *particleColor;
// Specifies the normalized variation of the color.
// With x : hue variation, y : saturation variation, z : brightness variation, w : alpha variation. Animatable.
@property(nonatomic) SCNVector4 particleColorVariation;
// Specifies the initial size of the particle. Animatable.
@property(nonatomic) CGFloat particleSize;
// Specifies the initial size variation of the particle. Animatable.
@property(nonatomic) CGFloat particleSizeVariation;
// Specifies the initial intensity of the particle. Animatable.
@property(nonatomic) CGFloat particleIntensity API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
// Specifies the initial intensity variation of the particle. Animatable.
@property(nonatomic) CGFloat particleIntensityVariation API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
// Specifies the blend mode to use to render the particle system. Defaults to SCNParticleBlendModeAdditive.
@property(nonatomic) SCNParticleBlendMode blendMode;
// Specifies whether a black pass is required or not when rendering the particle system.
// This reinforces the contrast of additive/light systems. Defaults to NO.
@property(nonatomic, getter=isBlackPassEnabled) BOOL blackPassEnabled;
// Specifies the orientation mode of the particles. Defaults to SCNParticleOrientationModeBillboardScreenAligned.
@property(nonatomic) SCNParticleOrientationMode orientationMode;
// Specifies the sorting mode of the particles. Defaults to SCNParticleSortingModeNone.
@property(nonatomic) SCNParticleSortingMode sortingMode;
// Enables the lighting of particle systems
@property(nonatomic, getter=isLightingEnabled) BOOL lightingEnabled;
#pragma mark Particle Simulation
// Enables the use of the gravity defined in SCNPhysicsWorld
@property(nonatomic) BOOL affectedByGravity;
// Enables the effect of the physics fields added to the SCNPhysicsWorld
@property(nonatomic) BOOL affectedByPhysicsFields;
// Specifies whether particles die on collision
@property(nonatomic) BOOL particleDiesOnCollision;
// Specifies an array of SCNNode to collide with.
@property(nonatomic, copy, nullable) NSArray<SCNNode *> *colliderNodes;
// Specifies the particle mass. Animatable.
@property(nonatomic) CGFloat particleMass;
// Specifies the particle mass variation. Animatable.
@property(nonatomic) CGFloat particleMassVariation;
// Specifies the particle bounce. Animatable.
@property(nonatomic) CGFloat particleBounce;
// Specifies the particle bounce variation. Animatable.
@property(nonatomic) CGFloat particleBounceVariation;
// Specifies the particle friction. Animatable.
@property(nonatomic) CGFloat particleFriction;
// Specifies the particle friction variation. Animatable.
@property(nonatomic) CGFloat particleFrictionVariation;
// Specifies the charge on the particle. Charge determines the degree to which a particle is affected by
// electric and magnetic fields. Note that this is a unitless quantity, it is up to the developer to
// set charge and field strength appropriately. Defaults to 0.0. Animatable.
@property(nonatomic) CGFloat particleCharge;
// Specifies the particle charge variation. Animatable.
@property(nonatomic) CGFloat particleChargeVariation;
// Specifies the particle air resistance. Defaults to 0. Animatable.
@property(nonatomic) CGFloat dampingFactor;
// Specifies the simulation speed multiplier. Defaults to 1. Animatable.
@property(nonatomic) CGFloat speedFactor;
// Specifies whether particles stretch along their direction. Defaults to 0. Animatable.
@property(nonatomic) CGFloat stretchFactor;
// Specifies the receiver's fresnel exponent value. Defaults to 3. Animatable.
// Only used if the particleImage is a cube map. The bigger the amount, the more concentrated the reflection is around the edges
@property(nonatomic) CGFloat fresnelExponent;
// Property controllers.
@property(nonatomic, copy, nullable) NSDictionary<SCNParticleProperty, SCNParticlePropertyController *> *propertyControllers;
// Remove all the already-emitted particles and restart the simulation.
- (void)reset;
// Events handling
// "block" will be invoked for particles that trigger the specified event, with the data and dataStride that corresponds to "properties". The block should only update the particle properties reference by the "indices" passed as argument in the block.
- (void)handleEvent:(SCNParticleEvent)event forProperties:(NSArray<SCNParticleProperty> *)properties withBlock:(SCNParticleEventBlock)block;
// Modifications handling
// "block" will be invoked at every simulation step at the specified stage. The data and dataStride passed to the block will corresponds to the specified "properties".
- (void)addModifierForProperties:(NSArray<SCNParticleProperty> *)properties atStage:(SCNParticleModifierStage)stage withBlock:(SCNParticleModifierBlock)block;
- (void)removeModifiersOfStage:(SCNParticleModifierStage)stage;
- (void)removeAllModifiers;
@end
@interface SCNNode (SCNParticleSystemSupport)
// Add a particle system to the receiver.
- (void)addParticleSystem:(SCNParticleSystem *)system API_AVAILABLE(macos(10.10));
// Remove all particle systems of the receiver.
- (void)removeAllParticleSystems API_AVAILABLE(macos(10.10));
// Remove the specified particle system from the receiver.
- (void)removeParticleSystem:(SCNParticleSystem *)system API_AVAILABLE(macos(10.10));
// The particle systems attached to the node.
@property(readonly, nullable) NSArray<SCNParticleSystem *> *particleSystems API_AVAILABLE(macos(10.10));
@end
@interface SCNScene (SCNParticleSystemSupport)
// Add a particle system at the given location.
- (void)addParticleSystem:(SCNParticleSystem *)system withTransform:(SCNMatrix4)transform API_AVAILABLE(macos(10.10));
// Remove all particle systems in the scene.
- (void)removeAllParticleSystems API_AVAILABLE(macos(10.10));
// Remove the specified particle system from the receiver.
- (void)removeParticleSystem:(SCNParticleSystem *)system API_AVAILABLE(macos(10.10));
// The particle systems attached to the scene that are active.
@property(readonly, nullable) NSArray<SCNParticleSystem *> *particleSystems API_AVAILABLE(macos(10.10));
@end
NS_ASSUME_NONNULL_END
// ========== SceneKit.framework/Headers/SceneKit.h
//
// SceneKit.h
// SceneKit
//
// Copyright © 2012-2019 Apple Inc. All rights reserved.
//
/*! @framework SceneKit
@abstract A high-level 3D scene framework.
@discussion SceneKit lets you easily load, manipulate, and render 3D scenes.
*/
//types
#import <SceneKit/SceneKitTypes.h>
//protocols
#import <SceneKit/SCNAnimation.h>
#import <SceneKit/SCNBoundingVolume.h>
#import <SceneKit/SCNSceneRenderer.h>
#import <SceneKit/SCNShadable.h>
//renderers
#import <SceneKit/SCNView.h>
#import <SceneKit/SCNRenderer.h>
//classes
#import <SceneKit/SCNScene.h>
#import <SceneKit/SCNSceneSource.h>
#import <SceneKit/SCNNode.h>
#import <SceneKit/SCNLight.h>
#import <SceneKit/SCNCamera.h>
#import <SceneKit/SCNMaterial.h>
#import <SceneKit/SCNMaterialProperty.h>
#import <SceneKit/SCNGeometry.h>
#import <SceneKit/SCNParametricGeometry.h>
#import <SceneKit/SCNTransaction.h>
#import <SceneKit/SCNMorpher.h>
#import <SceneKit/SCNSkinner.h>
#import <SceneKit/SCNConstraint.h>
#import <SceneKit/SCNLevelOfDetail.h>
#import <SceneKit/SCNParticleSystem.h>
#import <SceneKit/SCNPhysicsBody.h>
#import <SceneKit/SCNPhysicsField.h>
#import <SceneKit/SCNPhysicsShape.h>
#import <SceneKit/SCNPhysicsWorld.h>
#import <SceneKit/SCNPhysicsContact.h>
#import <SceneKit/SCNPhysicsBehavior.h>
#import <SceneKit/SCNTechnique.h>
#import <SceneKit/SCNReferenceNode.h>
#import <SceneKit/SCNAudioSource.h>
#import <SceneKit/SCNHitTest.h>
#import <SceneKit/SCNCameraController.h>
//scripting
#import <SceneKit/SCNJavascript.h>
//deprecated
#import <SceneKit/SceneKitDeprecated.h>
// ========== SceneKit.framework/Headers/SCNSceneRenderer.h
//
// SCNSceneRenderer.h
// SceneKit
//
// Copyright © 2012-2019 Apple Inc. All rights reserved.
//
#import <SceneKit/SceneKitTypes.h>
#import <SceneKit/SCNHitTest.h>
NS_ASSUME_NONNULL_BEGIN
@class SCNNode;
@class SCNScene;
@protocol SCNSceneRendererDelegate;
@class SKScene;
@class SKTransition;
@class MTLRenderPassDescriptor;
@protocol MTLRenderCommandEncoder;
@protocol MTLCommandBuffer;
@class AVAudioEngine;
@class AVAudioEnvironmentNode;
/*!
@enum SCNAntialiasingMode
@abstract antialiasing modes for scene renderers
*/
typedef NS_ENUM(NSUInteger, SCNAntialiasingMode) {
SCNAntialiasingModeNone,
SCNAntialiasingModeMultisampling2X,
SCNAntialiasingModeMultisampling4X
} API_AVAILABLE(macos(10.10));
/*!
@enum SCNRenderingAPI
@abstract rendering API used by SCNView and SCNRenderer.
@discussion Default preferred API is SCNRenderingAPIMetal on iOS and it depends on the configuration on macOS.
If Metal is requested but not available then it fallbacks to SCNRenderingAPIOpenGLES2 on iOS and to SCNRenderingAPIOpenGLLegacy on macOS.
*/
typedef NS_ENUM(NSUInteger, SCNRenderingAPI) {
SCNRenderingAPIMetal,
SCNRenderingAPIOpenGLES2 API_UNAVAILABLE(uikitformac)
} API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@enum SCNDebugOptions
@abstract Debug options.
*/
typedef NS_OPTIONS(NSUInteger, SCNDebugOptions) {
SCNDebugOptionNone = 0,
SCNDebugOptionShowPhysicsShapes = 1 << 0, //show physics shape
SCNDebugOptionShowBoundingBoxes = 1 << 1, //show object bounding boxes
SCNDebugOptionShowLightInfluences = 1 << 2, //show objects's light influences
SCNDebugOptionShowLightExtents = 1 << 3, //show light extents
SCNDebugOptionShowPhysicsFields = 1 << 4, //show SCNPhysicsFields forces and extents
SCNDebugOptionShowWireframe = 1 << 5, //show wireframe on top of objects
SCNDebugOptionRenderAsWireframe API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)) = 1 << 6, //render objects as wireframe
SCNDebugOptionShowSkeletons API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)) = 1 << 7, //show skinning bones
SCNDebugOptionShowCreases API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)) = 1 << 8, //show subdivision creases
SCNDebugOptionShowConstraints API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)) = 1 << 9, //show slider constraint
SCNDebugOptionShowCameras API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)) = 1 << 10, //show cameras
} API_AVAILABLE(macos(10.11), ios(9.0));
/*! @protocol SCNSceneRenderer
@abstract Protocol adopted by the various renderers (SCNView, SCNLayer, SCNRenderer)
*/
@protocol SCNSceneRenderer <NSObject>
@required
/*!
@property scene
@abstract Specifies the scene of the receiver.
*/
@property(nonatomic, retain, nullable) SCNScene *scene;
/*!
@method presentScene:withTransition:incomingPointOfView:
@abstract Present a SCNScene in the receiver, replacing the current scene.
@param scene The new scene to present.
@param transition the transition to use when presenting the scene.
@param pointOfView the point of view to use to render the new scene.
@param completionHandler the block invoked on completion.
*/
- (void)presentScene:(SCNScene *)scene withTransition:(SKTransition *)transition incomingPointOfView:(nullable SCNNode *)pointOfView completionHandler:(nullable void (^)(void))completionHandler API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property sceneTime
@abstract Specifies the current "scene time" to display the scene.
@discussion The scene time only affect scene time based animations (see SCNAnimation.h "usesSceneTimeBase" and SCNSceneSource.h "SCNSceneSourceAnimationImportPolicyKey" for how to create scene time based animations). Scene time based animations and this property are typically used by tools and viewer to ease seeking in time while previewing a scene.
*/
@property(nonatomic) NSTimeInterval sceneTime API_AVAILABLE(macos(10.10));
/*!
@property delegate
@abstract Specifies the renderer delegate.
*/
@property(nonatomic, unsafe_unretained, nullable) id <SCNSceneRendererDelegate> delegate;
/*!
@method hitTest:options:
@abstract Returns an array of SCNHitTestResult for each node that contains a specified point.
@param point A point in the coordinate system of the receiver.
@param options Optional parameters (see the "Hit test options" group for the available options).
*/
- (NSArray<SCNHitTestResult *> *)hitTest:(CGPoint)point options:(nullable NSDictionary<SCNHitTestOption, id> *)options;
/*!
@method isNodeInsideFrustum:withPointOfView:
@abstract Test whether node is visible from the specified point of view.
@param node The node to test the visibility of.
@param pointOfView The point of view used to test the visibility.
@discussion Return YES if the node is inside or intersects the clipping planes of the point of view. This method doesn't test if 'node' is occluded by another node.
*/
- (BOOL)isNodeInsideFrustum:(SCNNode *)node withPointOfView:(SCNNode *)pointOfView API_AVAILABLE(macos(10.9));
/*!
@method nodesInsideFrustumWithPointOfView:
@abstract Returns an array containing the nodes visible from the specified point of view.
@param pointOfView The point of view used to test the visibility.
@discussion Returns an array of all the nodes that are inside or intersects the clipping planes of the point of view. Starting in macOS10.13/iOS11 this method work with the presentation tree.
*/
- (NSArray<SCNNode *> *)nodesInsideFrustumWithPointOfView:(SCNNode *)pointOfView API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@method projectPoint
@abstract Projects a point in the world coordinate system using the receiver's current point of view and viewport.
@param point The world position to be projected.
@discussion A point projected from the near (resp. far) clip plane will have a z component of 0 (resp. 1).
*/
- (SCNVector3)projectPoint:(SCNVector3)point API_AVAILABLE(macos(10.9));
/*!
@method unprojectPoint
@abstract Unprojects a screenspace 2D point with depth info using the receiver's current point of view and viewport.
@param point The screenspace position to be unprojected.
@discussion A point whose z component is 0 (resp. 1) is unprojected on the near (resp. far) clip plane.
*/
- (SCNVector3)unprojectPoint:(SCNVector3)point API_AVAILABLE(macos(10.9));
/*!
@property playing
@abstract Returns YES if the scene is playing, NO otherwise.
*/
@property(getter=isPlaying) BOOL playing;
/*!
@property loops
@abstract Indicates whether the receiver restarts playback when it reaches the end of its content. Default: YES.
@discussion YES when the receiver restarts playback when it finishes, NO otherwise.
*/
@property(nonatomic) BOOL loops;
/*!
@property pointOfView
@abstract Specifies the point of view used to render the scene.
@discussion A point of view must have either a camera or a spot light attached.
*/
@property(nonatomic, retain, nullable) SCNNode *pointOfView;
/*!
@property autoenablesDefaultLighting
@abstract Specifies whether the receiver should automatically light up scenes that have no light source. The default is NO.
@discussion When enabled, a diffuse light is automatically added and placed while rendering scenes that have no light or only ambient lights.
*/
@property(nonatomic) BOOL autoenablesDefaultLighting;
/*!
@property jitteringEnabled
@abstract Specifies whether the receiver should jitter the rendered scene to reduce aliasing artifacts.
@discussion When enabled, the jittering is performed asynchronously and automatically by SCNView and SCNLayer. It is done synchronously by SCNRenderer.
*/
@property(nonatomic, getter=isJitteringEnabled) BOOL jitteringEnabled;
/*!
@property temporalAntialiasingEnabled
@abstract Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency.
*/
@property(nonatomic, getter=isTemporalAntialiasingEnabled) BOOL temporalAntialiasingEnabled API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));;
/*!
@method prepareObject:shouldAbortBlock:
@abstract Prepare the specified object for drawing.
@param object The object to prepare. It can be an instance of SCNScene, SCNNode, SCNGeometry, or SCNMaterial
@param block This block will be called repeatedly while the object is prepared. Return YES if you want the operation to abort.
@discussion Returns YES if the object was prepared successfully, NO if it was canceled. This method may be triggered from a secondary thread. This method is observable using NSProgress.
*/
- (BOOL)prepareObject:(id)object shouldAbortBlock:(nullable NS_NOESCAPE BOOL (^)(void))block API_AVAILABLE(macos(10.9));
/*!
@method prepareObjects:withCompletionHandler:
@abstract Prepare the specified objects for drawing on the background.
@param objects The objects to prepare. It can be one or more instances of SCNScene, SCNNode, SCNGeometry, or SCNMaterial
@param completionHandler This block will be called when all objects has been prepared, or on failure.
@discussion This method is observable using NSProgress.
*/
- (void)prepareObjects:(NSArray *)objects withCompletionHandler:(nullable void (^)(BOOL success))completionHandler API_AVAILABLE(macos(10.10));
/*!
@property showsStatistics
@abstract Determines whether the receiver should display statistics info like FPS. Defaults to NO.
@discussion When set to YES, statistics are displayed in a overlay on top of the rendered scene.
*/
@property(nonatomic) BOOL showsStatistics API_AVAILABLE(macos(10.9));
/*!
@property debugOptions
@abstract Specifies the debug options of the receiver. Defaults to SCNDebugOptionNone.
*/
@property(nonatomic) SCNDebugOptions debugOptions API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property overlaySKScene
@abstract Specifies the overlay of the receiver as a SpriteKit scene instance. Defaults to nil.
*/
@property(nonatomic, retain, nullable) SKScene *overlaySKScene API_AVAILABLE(macos(10.10));
/*!
@property renderingAPI
@abstract Specifies the rendering API associated to the receiver.
@discussion This is the rendering API effectively used by the receiver. You can specify a preferred rendering API when initializing a view programmatically (see SCNPreferredRenderingAPI in SCNSceneRenderer.h) or using Interface Builder's SCNView inspector.
*/
@property(nonatomic, readonly) SCNRenderingAPI renderingAPI API_AVAILABLE(macos(10.11), ios(9.0));
#if SCN_ENABLE_OPENGL
/*!
@property context
@abstract A Core OpenGL render context that is used as the render target (a CGLContextObj on macOS, an EAGLContext on iOS).
*/
@property(nonatomic, readonly, nullable) void *context;
#endif
#if SCN_ENABLE_METAL
/*!
@property currentRenderCommandEncoder
@abstract The current render command encoder if any. This property is only valid within the SCNSceneRendererDelegate methods and when renderering with Metal. Otherwise it is set to nil.
*/
@property(nonatomic, readonly, nullable) id <MTLRenderCommandEncoder> currentRenderCommandEncoder API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property device
@abstract The metal device of the renderer. This property is only valid on a renderer created with a Metal device. Otherwise it is set to nil.
*/
@property(nonatomic, readonly, nullable) id <MTLDevice> device API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property colorPixelFormat
@abstract The pixel format of the color attachment 0 of the renderer. This property is only valid on a renderer created with a Metal device.
*/
@property(nonatomic, readonly) MTLPixelFormat colorPixelFormat API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property depthPixelFormat
@abstract The pixel format of the depth attachment of the renderer. This property is only valid on a renderer created with a Metal device.
*/
@property(nonatomic, readonly) MTLPixelFormat depthPixelFormat API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property stencilPixelFormat
@abstract The pixel format of the stencil attachment of the renderer. This property is only valid on a renderer created with a Metal device.
*/
@property(nonatomic, readonly) MTLPixelFormat stencilPixelFormat API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property commandQueue
@abstract The command queue of the renderer. This property is only valid on a renderer created with a Metal device. Otherwise it is set to nil.
*/
@property(nonatomic, readonly, nullable) id <MTLCommandQueue> commandQueue API_AVAILABLE(macos(10.11), ios(9.0));
#endif
/*!
@property audioEngine
@abstract Contains the instance of audio engine used by the scene.
@discussion The audio engine can be used to add custom nodes to the audio graph.
*/
@property(nonatomic, readonly) AVAudioEngine *audioEngine API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property audioEnvironmentNode
@abstract Contains the instance of audio environment node used by the scene to spacialize sounds.
*/
@property(nonatomic, readonly) AVAudioEnvironmentNode *audioEnvironmentNode API_AVAILABLE(macos(10.11), ios(9.0)) API_UNAVAILABLE(watchos);
/*!
@property audioListener
@abstract Use this property to set the audio node to use as the listener position and orientation when rendering positional audio for this scene. The default is nil which means that the current point of view will be used dynamically.
*/
@property(nonatomic, retain, nullable) SCNNode *audioListener API_AVAILABLE(macos(10.11), ios(9.0));
/*!
@property currentViewport
@abstract Returns the current viewport for this renderer, can be used to get the actual viewport from within the delegate callback during a live resize.
*/
@property(nonatomic, readonly) CGRect currentViewport API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
/*!
@property usesReverseZ
@abstract Specifies if the renderer should use the reverse Z technique. Defaults to YES.
@discussion This property is only valid on a renderer created with a Metal device.
*/
@property (nonatomic) BOOL usesReverseZ API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
@end
/*!
@protocol SCNSceneRendererDelegate
@abstract Implement this protocol to perform operations at various times during the rendering
*/
@protocol SCNSceneRendererDelegate <NSObject>
@optional
/*!
@method renderer:updateAtTime:
@abstract Implement this to perform per-frame game logic. Called exactly once per frame before any animation and actions are evaluated and any physics are simulated.
@param renderer The renderer that will render the scene.
@param time The time at which to update the scene.
@discussion All modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
*/
- (void)renderer:(id <SCNSceneRenderer>)renderer updateAtTime:(NSTimeInterval)time API_AVAILABLE(macos(10.10));
/*!
@method renderer:didApplyAnimationsAtTime:
@abstract Invoked on the delegate once the scene renderer did apply the animations.
@param renderer The renderer that did render the scene.
@param time The time at which the animations were applied.
@discussion All modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
*/
- (void)renderer:(id <SCNSceneRenderer>)renderer didApplyAnimationsAtTime:(NSTimeInterval)time API_AVAILABLE(macos(10.10));
/*!
@method renderer:didSimulatePhysicsAtTime:
@abstract Invoked on the delegate once the scene renderer did simulate the physics.
@param renderer The renderer that did render the scene.
@param time The time at which the physics were simulated.
@discussion All modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
*/
- (void)renderer:(id <SCNSceneRenderer>)renderer didSimulatePhysicsAtTime:(NSTimeInterval)time API_AVAILABLE(macos(10.10));
/*!
@method renderer:didApplyConstraintsAtTime:
@abstract Invoked on the delegate once the scene renderer did apply the constraints.
@param renderer The renderer that did render the scene.
@param time The time at which the constraints were simulated.
@discussion All modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
*/
- (void)renderer:(id <SCNSceneRenderer>)renderer didApplyConstraintsAtTime:(NSTimeInterval)time API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
/*!
@method renderer:willRenderScene:atTime:
@abstract Invoked on the delegate before the scene renderer renders the scene. At this point the openGL context and the destination framebuffer are bound.
@param renderer The renderer that will render the scene.
@param scene The scene to be rendered.
@param time The time at which the scene is to be rendered.
@discussion Starting in 10.10 all modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
*/
- (void)renderer:(id <SCNSceneRenderer>)renderer willRenderScene:(SCNScene *)scene atTime:(NSTimeInterval)time;
/*!
@method renderer:didRenderScene:atTime:
@abstract Invoked on the delegate once the scene renderer did render the scene.
@param renderer The renderer that did render the scene.
@param scene The rendered scene.
@param time The time at which the scene was rendered.
@discussion Starting in 10.10 all modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
*/
- (void)renderer:(id <SCNSceneRenderer>)renderer didRenderScene:(SCNScene *)scene atTime:(NSTimeInterval)time;
@end
NS_ASSUME_NONNULL_END
// ========== SceneKit.framework/Headers/SCNLight.h
//
// SCNLight.h
// SceneKit
//
// Copyright © 2012-2019 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <SceneKit/SCNAnimation.h>
#import <SceneKit/SCNTechnique.h>
NS_ASSUME_NONNULL_BEGIN
@class SCNMaterialProperty;
/*!