peachsim 0.1.2672 → 0.1.2673

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +55 -16
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-ANAWH2QA.mjs → acorn-336UC4RP.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-KHA7KQ2X.mjs → chunk-3MZPG7IR.mjs} +1 -1
  28. package/dist-lib/esm-chunks/{chunk-WQ7BYLAO.mjs → chunk-3ZNNDHDI.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-2ST4JDW5.mjs → chunk-4GG2PPSU.mjs} +6 -6
  30. package/dist-lib/esm-chunks/{chunk-EO3PGGK6.mjs → chunk-5HOIZ6MQ.mjs} +2 -2
  31. package/dist-lib/esm-chunks/{chunk-UE244MGN.mjs → chunk-7H7ZOZM2.mjs} +4 -4
  32. package/dist-lib/esm-chunks/{chunk-K7WLABS4.mjs → chunk-BBGS4DZC.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-SCA6PLSH.mjs → chunk-C6REX7EL.mjs} +46 -18
  34. package/dist-lib/esm-chunks/{chunk-NRQTKXI7.mjs → chunk-D5FFCNAT.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-YDNET6JM.mjs → chunk-E4AUUK5I.mjs} +3 -3
  36. package/dist-lib/esm-chunks/{chunk-2MOZQHG4.mjs → chunk-FNBMSPNT.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-2SXXNQGP.mjs → chunk-IU77JRSH.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-AGIHBY7T.mjs → chunk-KA7WVS2K.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-LHIE6DGX.mjs → chunk-KXE5HCNR.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-APGN5EZ5.mjs → chunk-L5O5XBPQ.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-WE5V55UP.mjs → chunk-OZCOKJ7M.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-GUMH4RAH.mjs → chunk-P2BIUM7R.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-5U2S7VCB.mjs → chunk-R6ZDUB54.mjs} +6 -6
  44. package/dist-lib/esm-chunks/{chunk-QOEYNFFI.mjs → chunk-RF5IVPXG.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-MAP6Q5WF.mjs → chunk-S4OMJTWN.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-ZAYWJJUC.mjs → chunk-VF6MYLEZ.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-RWOJIXIU.mjs → chunk-WSESTR3O.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-GENEGBSI.mjs → chunk-XJLTGEVV.mjs} +5 -5
  49. package/dist-lib/esm-chunks/{chunk-EUUZ5SP5.mjs → chunk-Y6ZJLACG.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-GVPPWC3F.mjs → chunk-YTDJZT5E.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-IPOQ2B24.mjs → metro-layout-parser-NROJOPLZ.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-GIDTOI6B.mjs → swift-package-prebuilt-2WRORWMA.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-L4ZL7YUV.mjs → swift-sdk-app-module-SKXQBJ4J.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-KKWMNMLJ.mjs → swift-sdk-image-WFS54ICR.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-ZPRBMA7N.mjs → swift-sdk-image-producer-P6FOBZHK.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +54 -15
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +55 -16
  61. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +85 -85
  87. package/dist-lib/public-origins-lib.json +64 -64
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +55 -16
  95. package/dist-lib/swift-compile.cjs +33 -5
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/package.json +1 -1
  123. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h +1 -261
  124. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureTypes.h +2 -215
  125. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MTLAccelerationStructureTypes.h +218 -0
  126. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +265 -0
  127. package/src/swift-compile.ts +46 -4
  128. package/src/swift-host.ts +9 -2
  129. package/src/swift-objc-compile.ts +14 -5
@@ -7,6 +7,7 @@
7
7
 
8
8
  #import <Foundation/Foundation.h>
9
9
  #import <Metal/MTLDefines.h>
10
+ #import <MetalTypes/MetalTypes.h>
10
11
  #import <Metal/MTLTypes.h>
11
12
  #import <Metal/MTLArgument.h>
12
13
  #import <Metal/MTLStageInputOutputDescriptor.h>
@@ -77,34 +78,6 @@ typedef NS_OPTIONS(NSUInteger, MTLAccelerationStructureUsage) {
77
78
  MTLAccelerationStructureUsageMinimizeMemory API_AVAILABLE(macos(26.0), ios(26.0)) = (1 << 5),
78
79
  } API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0));
79
80
 
80
- typedef NS_OPTIONS(uint32_t, MTLAccelerationStructureInstanceOptions) {
81
- /**
82
- * @brief No options
83
- */
84
- MTLAccelerationStructureInstanceOptionNone = 0,
85
-
86
- /**
87
- * @brief Disable triangle back or front face culling
88
- */
89
- MTLAccelerationStructureInstanceOptionDisableTriangleCulling = (1 << 0),
90
-
91
- /**
92
- * @brief Override triangle front-facing winding. By default, the winding is
93
- * assumed to be clockwise unless overridden by the intersector object. This overrides
94
- * the intersector's winding order.
95
- */
96
- MTLAccelerationStructureInstanceOptionTriangleFrontFacingWindingCounterClockwise = (1 << 1),
97
-
98
- /**
99
- * @brief Geometry is opaque
100
- */
101
- MTLAccelerationStructureInstanceOptionOpaque = (1 << 2),
102
-
103
- /**
104
- * @brief Geometry is non-opaque
105
- */
106
- MTLAccelerationStructureInstanceOptionNonOpaque = (1 << 3),
107
- } API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0));
108
81
 
109
82
  typedef NS_ENUM(NSInteger, MTLMatrixLayout) {
110
83
  /**
@@ -177,23 +150,6 @@ MTL_EXPORT API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0))
177
150
  @property (nonatomic) NSUInteger primitiveDataElementSize API_AVAILABLE(macos(13.0), ios(16.0));
178
151
  @end
179
152
 
180
- /**
181
- * @brief Describes what happens to the object before the first motion key and after the last
182
- * motion key.
183
- */
184
- typedef NS_ENUM(uint32_t, MTLMotionBorderMode){
185
-
186
- /**
187
- * @brief Motion is stopped. (default)
188
- */
189
- MTLMotionBorderModeClamp = 0,
190
-
191
- /**
192
- * @brief Object disappears
193
- */
194
- MTLMotionBorderModeVanish = 1
195
- } API_AVAILABLE(macos(12.0), ios(15.0), tvos(16.0));
196
-
197
153
  /**
198
154
  * @brief Descriptor for a primitive acceleration structure
199
155
  */
@@ -759,65 +715,6 @@ MTL_EXPORT API_AVAILABLE(macos(14.0), ios(17.0))
759
715
 
760
716
  @end
761
717
 
762
- typedef struct {
763
- /**
764
- * @brief Transformation matrix describing how to transform the bottom-level acceleration structure.
765
- */
766
- MTLPackedFloat4x3 transformationMatrix;
767
-
768
- /**
769
- * @brief Instance options
770
- */
771
- MTLAccelerationStructureInstanceOptions options;
772
-
773
- /**
774
- * @brief Instance mask used to ignore geometry during ray tracing
775
- */
776
- uint32_t mask;
777
-
778
- /**
779
- * @brief Used to index into intersection function tables
780
- */
781
- uint32_t intersectionFunctionTableOffset;
782
-
783
- /**
784
- * @brief Acceleration structure index to use for this instance
785
- */
786
- uint32_t accelerationStructureIndex;
787
- } MTLAccelerationStructureInstanceDescriptor API_AVAILABLE(macos(11.0), ios(14.0));
788
-
789
- typedef struct {
790
- /**
791
- * @brief Transformation matrix describing how to transform the bottom-level acceleration structure.
792
- */
793
- MTLPackedFloat4x3 transformationMatrix;
794
-
795
- /**
796
- * @brief Instance options
797
- */
798
- MTLAccelerationStructureInstanceOptions options;
799
-
800
- /**
801
- * @brief Instance mask used to ignore geometry during ray tracing
802
- */
803
- uint32_t mask;
804
-
805
- /**
806
- * @brief Used to index into intersection function tables
807
- */
808
- uint32_t intersectionFunctionTableOffset;
809
-
810
- /**
811
- * @brief Acceleration structure index to use for this instance
812
- */
813
- uint32_t accelerationStructureIndex;
814
-
815
- /**
816
- * @brief User-assigned instance ID to help identify this instance in an
817
- * application-defined way
818
- */
819
- uint32_t userID;
820
- } MTLAccelerationStructureUserIDInstanceDescriptor API_AVAILABLE(macos(12.0), ios(15.0), tvos(16.0));
821
718
 
822
719
  typedef NS_ENUM(NSUInteger, MTLAccelerationStructureInstanceDescriptorType) {
823
720
  /**
@@ -846,163 +743,6 @@ typedef NS_ENUM(NSUInteger, MTLAccelerationStructureInstanceDescriptorType) {
846
743
  MTLAccelerationStructureInstanceDescriptorTypeIndirectMotion API_AVAILABLE(macos(14.0), ios(17.0)) = 4,
847
744
  } API_AVAILABLE(macos(12.0), ios(15.0), tvos(16.0));
848
745
 
849
- typedef struct {
850
- /**
851
- * @brief Instance options
852
- */
853
- MTLAccelerationStructureInstanceOptions options;
854
-
855
- /**
856
- * @brief Instance mask used to ignore geometry during ray tracing
857
- */
858
- uint32_t mask;
859
-
860
- /**
861
- * @brief Used to index into intersection function tables
862
- */
863
- uint32_t intersectionFunctionTableOffset;
864
-
865
- /**
866
- * @brief Acceleration structure index to use for this instance
867
- */
868
- uint32_t accelerationStructureIndex;
869
-
870
- /**
871
- * @brief User-assigned instance ID to help identify this instance in an
872
- * application-defined way
873
- */
874
- uint32_t userID;
875
-
876
- /**
877
- * @brief The index of the first set of transforms describing one keyframe of the animation.
878
- * These transforms are stored in a separate buffer and they are uniformly distributed over
879
- * time time span of the motion.
880
- */
881
- uint32_t motionTransformsStartIndex;
882
-
883
- /**
884
- * @brief The count of motion transforms belonging to this motion which are stored in consecutive
885
- * memory addresses at the separate motionTransforms buffer.
886
- */
887
- uint32_t motionTransformsCount;
888
- /**
889
- * @brief Motion border mode describing what happens if acceleration structure is sampled
890
- * before motionStartTime
891
- */
892
- MTLMotionBorderMode motionStartBorderMode;
893
-
894
- /**
895
- * @brief Motion border mode describing what happens if acceleration structure is sampled
896
- * after motionEndTime
897
- */
898
- MTLMotionBorderMode motionEndBorderMode;
899
-
900
- /**
901
- * @brief Motion start time of this instance
902
- */
903
- float motionStartTime;
904
-
905
- /**
906
- * @brief Motion end time of this instance
907
- */
908
- float motionEndTime;
909
- } MTLAccelerationStructureMotionInstanceDescriptor API_AVAILABLE(macos(12.0), ios(15.0), tvos(16.0));
910
-
911
-
912
- typedef struct {
913
- /**
914
- * @brief Transformation matrix describing how to transform the bottom-level acceleration structure.
915
- */
916
- MTLPackedFloat4x3 transformationMatrix;
917
-
918
- /**
919
- * @brief Instance options
920
- */
921
- MTLAccelerationStructureInstanceOptions options;
922
-
923
- /**
924
- * @brief Instance mask used to ignore geometry during ray tracing
925
- */
926
- uint32_t mask;
927
-
928
- /**
929
- * @brief Used to index into intersection function tables
930
- */
931
- uint32_t intersectionFunctionTableOffset;
932
-
933
- /**
934
- * @brief User-assigned instance ID to help identify this instance in an
935
- * application-defined way
936
- */
937
- uint32_t userID;
938
-
939
- /**
940
- * @brief Acceleration structure resource handle to use for this instance
941
- */
942
- MTLResourceID accelerationStructureID;
943
- } MTLIndirectAccelerationStructureInstanceDescriptor API_AVAILABLE(macos(14.0), ios(17.0));
944
-
945
- typedef struct {
946
- /**
947
- * @brief Instance options
948
- */
949
- MTLAccelerationStructureInstanceOptions options;
950
-
951
- /**
952
- * @brief Instance mask used to ignore geometry during ray tracing
953
- */
954
- uint32_t mask;
955
-
956
- /**
957
- * @brief Used to index into intersection function tables
958
- */
959
- uint32_t intersectionFunctionTableOffset;
960
-
961
- /**
962
- * @brief User-assigned instance ID to help identify this instance in an
963
- * application-defined way
964
- */
965
- uint32_t userID;
966
-
967
- /**
968
- * @brief Acceleration structure resource handle to use for this instance
969
- */
970
- MTLResourceID accelerationStructureID;
971
-
972
- /**
973
- * @brief The index of the first set of transforms describing one keyframe of the animation.
974
- * These transforms are stored in a separate buffer and they are uniformly distributed over
975
- * time time span of the motion.
976
- */
977
- uint32_t motionTransformsStartIndex;
978
-
979
- /**
980
- * @brief The count of motion transforms belonging to this motion which are stored in consecutive
981
- * memory addresses at the separate motionTransforms buffer.
982
- */
983
- uint32_t motionTransformsCount;
984
- /**
985
- * @brief Motion border mode describing what happens if acceleration structure is sampled
986
- * before motionStartTime
987
- */
988
- MTLMotionBorderMode motionStartBorderMode;
989
-
990
- /**
991
- * @brief Motion border mode describing what happens if acceleration structure is sampled
992
- * after motionEndTime
993
- */
994
- MTLMotionBorderMode motionEndBorderMode;
995
-
996
- /**
997
- * @brief Motion start time of this instance
998
- */
999
- float motionStartTime;
1000
-
1001
- /**
1002
- * @brief Motion end time of this instance
1003
- */
1004
- float motionEndTime;
1005
- } MTLIndirectAccelerationStructureMotionInstanceDescriptor API_AVAILABLE(macos(14.0), ios(17.0));
1006
746
 
1007
747
  typedef NS_ENUM(NSInteger, MTLTransformType) {
1008
748
  /**
@@ -1,12 +1,4 @@
1
- #ifdef __METAL_VERSION__
2
- #import <metal_stdlib>
3
-
4
- typedef metal::packed_float3 MTLPackedFloat3;
5
- typedef metal::packed_float4 MTLPackedFloatQuaternion;
6
- #else
7
- #include <math.h>
8
- #include <stdint.h>
9
-
1
+ #ifndef __METAL_VERSION__
10
2
  #ifndef _WIN32
11
3
  #import <Metal/MTLDefines.h>
12
4
  #else
@@ -14,211 +6,6 @@ typedef metal::packed_float4 MTLPackedFloatQuaternion;
14
6
  #endif // _WIN32
15
7
 
16
8
  #include <Metal/MTL4BufferRange.h>
17
-
18
- typedef struct _MTLPackedFloat3 {
19
- union {
20
- struct {
21
- float x;
22
- float y;
23
- float z;
24
- };
25
- float elements[3];
26
- };
27
-
28
- #ifdef __cplusplus
29
- _MTLPackedFloat3()
30
- : x(0.0f), y(0.0f), z(0.0f)
31
- {
32
- }
33
-
34
- _MTLPackedFloat3(float x, float y, float z)
35
- : x(x), y(y), z(z)
36
- {
37
- }
38
-
39
- float & operator[](int idx) {
40
- return elements[idx];
41
- }
42
-
43
- const float & operator[](int idx) const {
44
- return elements[idx];
45
- }
46
- #endif
47
- } MTLPackedFloat3;
48
-
49
- MTL_INLINE MTLPackedFloat3 MTLPackedFloat3Make(float x, float y, float z)
50
- {
51
- MTLPackedFloat3 packedFloat3;
52
- packedFloat3.x = x;
53
- packedFloat3.y = y;
54
- packedFloat3.z = z;
55
- return packedFloat3;
56
- }
57
-
58
- typedef struct MTLPackedFloatQuaternion {
59
- float x;
60
- float y;
61
- float z;
62
- float w;
63
-
64
- #ifdef __cplusplus
65
- MTLPackedFloatQuaternion()
66
- : x(0.0f), y(0.0f), z(0.0f), w(1.0f)
67
- {
68
- }
69
-
70
- MTLPackedFloatQuaternion(float x, float y, float z, float w)
71
- : x(x), y(y), z(z), w(w)
72
- {
73
- }
74
-
75
- float & operator[](int idx) {
76
- float *elements = &x;
77
-
78
- return elements[idx];
79
- }
80
-
81
- const float & operator[](int idx) const {
82
- const float *elements = &x;
83
-
84
- return elements[idx];
85
- }
86
- #endif
87
- } MTLPackedFloatQuaternion;
88
-
89
- MTL_INLINE MTLPackedFloatQuaternion MTLPackedFloatQuaternionMake(float x, float y, float z, float w)
90
- {
91
- MTLPackedFloatQuaternion packedQuaternion;
92
- packedQuaternion.x = x;
93
- packedQuaternion.y = y;
94
- packedQuaternion.z = z;
95
- packedQuaternion.w = w;
96
- return packedQuaternion;
97
- }
98
-
99
- #endif
100
-
101
- typedef struct _MTLPackedFloat4x3 {
102
- MTLPackedFloat3 columns[4];
103
-
104
- #ifdef __cplusplus
105
- _MTLPackedFloat4x3() {
106
- columns[0] = MTLPackedFloat3(0.0f, 0.0f, 0.0f);
107
- columns[1] = MTLPackedFloat3(0.0f, 0.0f, 0.0f);
108
- columns[2] = MTLPackedFloat3(0.0f, 0.0f, 0.0f);
109
- columns[3] = MTLPackedFloat3(0.0f, 0.0f, 0.0f);
110
- }
111
-
112
- _MTLPackedFloat4x3(MTLPackedFloat3 column0, MTLPackedFloat3 column1, MTLPackedFloat3 column2, MTLPackedFloat3 column3) {
113
- columns[0] = column0;
114
- columns[1] = column1;
115
- columns[2] = column2;
116
- columns[3] = column3;
117
- }
118
-
119
- #ifndef __METAL_VERSION__
120
- MTLPackedFloat3 & operator[](int idx) {
121
- return columns[idx];
122
- }
123
-
124
- const MTLPackedFloat3 & operator[](int idx) const {
125
- return columns[idx];
126
- }
127
- #else
128
- thread MTLPackedFloat3 & operator[](int idx) thread {
129
- return columns[idx];
130
- }
131
-
132
- const thread MTLPackedFloat3 & operator[](int idx) const thread {
133
- return columns[idx];
134
- }
135
-
136
- device MTLPackedFloat3 & operator[](int idx) device {
137
- return columns[idx];
138
- }
139
-
140
- const device MTLPackedFloat3 & operator[](int idx) const device {
141
- return columns[idx];
142
- }
143
-
144
- const constant MTLPackedFloat3 & operator[](int idx) const constant {
145
- return columns[idx];
146
- }
147
- #endif
148
- #endif
149
- } MTLPackedFloat4x3;
150
-
151
- /**
152
- * @brief An axis aligned bounding box with a min and max point
153
- */
154
- typedef struct _MTLAxisAlignedBoundingBox {
155
- /**
156
- * @brief Minimum point
157
- */
158
- MTLPackedFloat3 min;
159
-
160
- /**
161
- * @brief Maximum point
162
- */
163
- MTLPackedFloat3 max;
164
-
165
- #ifdef __cplusplus
166
- _MTLAxisAlignedBoundingBox()
167
- : min(INFINITY, INFINITY, INFINITY),
168
- max(-INFINITY, -INFINITY, -INFINITY)
169
- {
170
- }
171
-
172
- #ifdef __METAL_VERSION__
173
- _MTLAxisAlignedBoundingBox() threadgroup = default;
174
9
  #endif
175
-
176
-
177
- _MTLAxisAlignedBoundingBox(MTLPackedFloat3 p)
178
- : min(p),
179
- max(p)
180
- {
181
- }
182
-
183
- _MTLAxisAlignedBoundingBox(MTLPackedFloat3 min, MTLPackedFloat3 max)
184
- : min(min),
185
- max(max)
186
- {
187
- }
188
- #endif
189
- } MTLAxisAlignedBoundingBox;
190
-
191
- /**
192
- * @brief A transformation represented by individual components such as translation and
193
- * rotation. The rotation is represented by a quaternion, allowing for correct motion
194
- * interpolation.
195
- */
196
- typedef struct {
197
- /**
198
- * @brief The scale of the instance applied before rotation alongside shear and pivot
199
- */
200
- MTLPackedFloat3 scale;
201
-
202
- /**
203
- * @brief The shear of the instance applied before rotation alongside scale and pivot
204
- */
205
- MTLPackedFloat3 shear;
206
-
207
- /**
208
- * @brief Translation applied before rotation alongside scale and shear. Allows
209
- * rotation to pivot around a point.
210
- */
211
- MTLPackedFloat3 pivot;
212
-
213
- /**
214
- * @brief The rotation of the instance as a normalized quaternion. Applied after scale,
215
- * shear, and pivot and before translation
216
- */
217
- MTLPackedFloatQuaternion rotation;
218
10
 
219
- /**
220
- * @brief The translation of the instance. Applied after rotation. Typically contains
221
- * the composition of object translation and the inverse of the pivot translation.
222
- */
223
- MTLPackedFloat3 translation;
224
- } MTLComponentTransform;
11
+ #import <MetalTypes/MTLAccelerationStructureTypes.h>