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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-foundation")]
use objc2_foundation::*;
#[cfg(feature = "objc2-metal")]
use objc2_metal::*;
#[cfg(feature = "objc2-scene-kit")]
use objc2_scene_kit::*;
use crate::*;
#[cfg(feature = "objc2")]
extern_class!(
/// A SceneKit geometry representing a face.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arscnfacegeometry?language=objc)
#[unsafe(super(SCNGeometry, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
pub struct ARSCNFaceGeometry;
);
#[cfg(all(
feature = "objc2",
feature = "objc2-foundation",
feature = "objc2-scene-kit"
))]
extern_conformance!(
unsafe impl NSCoding for ARSCNFaceGeometry {}
);
#[cfg(all(
feature = "objc2",
feature = "objc2-foundation",
feature = "objc2-scene-kit"
))]
extern_conformance!(
unsafe impl NSCopying for ARSCNFaceGeometry {}
);
#[cfg(all(
feature = "objc2",
feature = "objc2-foundation",
feature = "objc2-scene-kit"
))]
unsafe impl CopyingHelper for ARSCNFaceGeometry {
type Result = Self;
}
#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
extern_conformance!(
unsafe impl NSObjectProtocol for ARSCNFaceGeometry {}
);
#[cfg(all(
feature = "objc2",
feature = "objc2-foundation",
feature = "objc2-scene-kit"
))]
extern_conformance!(
unsafe impl NSSecureCoding for ARSCNFaceGeometry {}
);
#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
extern_conformance!(
unsafe impl SCNAnimatable for ARSCNFaceGeometry {}
);
#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
extern_conformance!(
unsafe impl SCNBoundingVolume for ARSCNFaceGeometry {}
);
#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
extern_conformance!(
unsafe impl SCNShadable for ARSCNFaceGeometry {}
);
#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
impl ARSCNFaceGeometry {
extern_methods!(
#[cfg(feature = "objc2-metal")]
/// Creates a new face geometry using a Metal device.
///
///
/// Parameter `device`: A Metal device.
///
/// Returns: A new face geometry.
#[unsafe(method(faceGeometryWithDevice:))]
#[unsafe(method_family = none)]
pub unsafe fn faceGeometryWithDevice(
device: &ProtocolObject<dyn MTLDevice>,
) -> Option<Retained<Self>>;
#[cfg(feature = "objc2-metal")]
/// Creates a new face geometry using a Metal device.
///
///
/// By default the regions between the eye lids as well as the region
/// between the lips are not covered by geometry. For using the face geometry as an
/// occlusion geometry set
/// `fillMesh`to YES. This will fill
/// in additional geometry into the gaps between the eye lids as well as into the
/// gap between the lips.
///
/// Parameter `fillMesh`: Whether to fill in additional geometry into the
/// gaps between the eye lids as well as into the gap between the lips.
///
///
/// Returns: A new face geometry.
#[unsafe(method(faceGeometryWithDevice:fillMesh:))]
#[unsafe(method_family = none)]
pub unsafe fn faceGeometryWithDevice_fillMesh(
device: &ProtocolObject<dyn MTLDevice>,
fill_mesh: bool,
) -> Option<Retained<Self>>;
#[cfg(feature = "ARFaceGeometry")]
/// Updates the geometry with the vertices of a face geometry.
///
///
/// Parameter `faceGeometry`: A face geometry.
#[unsafe(method(updateFromFaceGeometry:))]
#[unsafe(method_family = none)]
pub unsafe fn updateFromFaceGeometry(&self, face_geometry: &ARFaceGeometry);
/// Unavailable
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
/// Methods declared on superclass `SCNGeometry`.
#[cfg(all(feature = "objc2", feature = "objc2-scene-kit"))]
impl ARSCNFaceGeometry {
extern_methods!(
/// Creates and returns an empty geometry object.
///
/// An empty geometry may be used as the lowest level of detail of a geometry.
#[unsafe(method(geometry))]
#[unsafe(method_family = none)]
pub unsafe fn geometry() -> Retained<Self>;
#[cfg(feature = "objc2-foundation")]
/// Creates and returns a new geometry built from geometry sources and geometry elements.
///
/// Parameter `sources`: An array of geometry sources. If several geometry sources have the same semantic, only the first one is taken into account.
///
/// Parameter `elements`: An array of geometry elements. The sort order in the array determines the mapping between materials and geometry elements.
///
/// A geometry is made of geometry sources (at least `SCNGeometrySourceSemanticVertex`) and at least one geometry element. Multiple sources for texture coordinates are accepted. In that case the `mappingChannel` is implicitly set based on the order of the texture sources, starting at index 0.
#[unsafe(method(geometryWithSources:elements:))]
#[unsafe(method_family = none)]
pub unsafe fn geometryWithSources_elements(
sources: &NSArray<SCNGeometrySource>,
elements: Option<&NSArray<SCNGeometryElement>>,
) -> Retained<Self>;
#[cfg(feature = "objc2-foundation")]
/// Creates and returns a new geometry built from geometry sources and geometry elements, with per-source indexed geometry data.
///
/// Parameter `sources`: An array of geometry sources. If several geometry sources have the same semantic, only the first one is taken into account.
///
/// Parameter `elements`: An array of geometry elements. The sort order in the array determines the mapping between materials and geometry elements.
///
/// Parameter `sourceChannels`: An array of indices that describes, for each geometry source, which channel of the geometry elements to use.
///
/// ```text
/// Example: geometry made of 3 primitives (2 quads, 1 pentagon) using different indices to reference position and UV data (2 channels)
///
/// Positions ┆ POS0 POS3 POS4 ┆ quad quad pentagon quad quad pentagon ┆ SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
/// 0 │ (0.0, 0.0, 0.0) ┆ ┌───────────┬───────────┐ ┆ ┌─────┐ ┌─────┐ ┌───────┐ ┌─────┐ ┌─────┐ ┌───────┐ ┆ primitiveType:SCNGeometryPrimitiveTypePolygon
/// 1 │ (0.0, 1.0, 0.0) ┆ │UV0 UV3│UV0 UV3│ ┆ 4 4 5 0 1 2 3 5 4 3 2 7 6 5 2 1 0 1 2 3 2 3 0 1 1 2 3 4 0 ┆ primitiveCount:3
/// 2 │ (1.0, 0.0, 0.0) ┆ │ │ │ ┆ └───┘ └───────────────────────┘ └───────────────────────┘ ┆ indicesChannelCount:2
/// 3 │ (1.0, 1.0, 0.0) ┆ │ A │ B │ ┆ polygons channel 0 channel 1 ┆ interleavedIndicesChannels:…
/// 4 │ (2.0, 0.0, 0.0) ┆ │ │ │ ┆ (positions) (UVs) ┆ bytesPerIndex:…];
/// 5 │ (2.0, 1.0, 0.0) ┆ │UV1 UV2│UV1 UV2│ ┆ ┆
/// 6 │ (2.0, 2.0, 0.0) ┆ POS1 ├───────────┴───────────┤ POS5 ┆ ┆ SCNGeometry *geometry = [SCNGeometry geometryWithSources:
/// @
/// [positionSource, texcoordsSource]
/// 7 │ (0.0, 2.0, 0.0) ┆ │UVO UV4 UV3│ ┆ ┆ elements:
/// @
/// [element]
/// ┆ │ POS2 │ ┆ quad A quad B pentagon C ┆ sourceChannels:
/// @
/// [0, 1]];
/// UVs ┆ │ │ ┆ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ ┆
/// 0 │ (0.0, 0.0) ┆ │ C │ ┆ 4 4 5 0 0 1 1 2 2 3 3 5 2 4 3 3 0 2 1 7 1 6 2 5 3 2 4 1 0 ┆
/// 1 │ (0.0, 1.0) ┆ │ │ ┆ └───┘└──────────────────────────────────────────────────┘ ┆
/// 2 │ (1.0, 1.0) ┆ │UV1 UV2│ ┆ polygons interleaved channels ┆
/// 3 │ (1.0, 0.0) ┆ └───────────────────────┘ ┆ (positions and UVs) ┆
/// 4 │ (0.5, 0.0) ┆ POS7 POS6 ┆ ┆
///
/// Example: geometry made of 3 primitives (2 quads, 1 pentagon) using the same indices to reference position and UV data (1 channel)
///
/// Positions ┆ POS0 POS3 POS4 ┆ quad A quad B pentagon C ┆ SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
/// 0 │ (0.0, 4.0, 0.0) ┆ ┌───────────┬───────────┐ ┆ ┌────────┐ ┌────────┐ ┌───────────┐ ┆ primitiveType:SCNGeometryPrimitiveTypePolygon
/// 1 │ (0.0, 2.0, 0.0) ┆ │UV0 UV3│UV3 UV4│ ┆ 4 4 5 0 1 2 3 5 4 3 2 7 6 5 2 1 ┆ primitiveCount:3
/// 2 │ (2.0, 2.0, 0.0) ┆ │ │ │ ┆ └───┘ └───────────────────────────────────┘ ┆ bytesPerIndex:…];
/// 3 │ (2.0, 4.0, 0.0) ┆ │ A │ B │ ┆ polygons channel 0 ┆
/// 4 │ (4.0, 4.0, 0.0) ┆ │ │ │ ┆ (positions and UVs) ┆ SCNGeometry *geometry = [SCNGeometry geometryWithSources:
/// @
/// [positionSource, texcoordsSource]
/// 5 │ (4.0, 2.0, 0.0) ┆ │UV1 UV2│UV2 UV5│ ┆ ┆ elements:
/// @
/// [element]];
/// 6 │ (4.0, 0.0, 0.0) ┆ POS1 ├───────────┴───────────┤ POS5 ┆ ┆
/// 7 │ (0.0, 0.0, 0.0) ┆ │UV1 UV2 UV5│ ┆ ┆ === or equivalently ===
/// ┆ │ POS2 │ ┆ ┆
/// UVs ┆ │ │ ┆ ┆ SCNGeometryElement *element = [SCNGeometryElement geometryElementWithData:…
/// 0 │ (0.0, 0.0) ┆ │ C │ ┆ ┆ primitiveType:SCNGeometryPrimitiveTypePolygon
/// 1 │ (0.0, 0.5) ┆ │ │ ┆ ┆ primitiveCount:3
/// 2 │ (0.5, 0.5) ┆ │UV7 UV6│ ┆ ┆ indicesChannelCount:1
/// 3 │ (0.5, 0.0) ┆ └───────────────────────┘ ┆ ┆ interleavedIndicesChannels:…
/// 4 │ (1.0, 0.0) ┆ POS7 POS6 ┆ ┆ bytesPerIndex:…];
/// 5 │ (1.0, 0.5) ┆ ┆ ┆
/// 6 │ (1.0, 1.0) ┆ ┆ ┆ SCNGeometry *geometry = [SCNGeometry geometryWithSources:
/// @
/// [positionSource, texcoordsSource]
/// 7 │ (0.0, 1.0) ┆ ┆ ┆ elements:
/// @
/// [element]
/// ┆ ┆ ┆ sourceChannels:
/// @
/// [0, 0]]; ┆
/// ```
#[unsafe(method(geometryWithSources:elements:sourceChannels:))]
#[unsafe(method_family = none)]
pub unsafe fn geometryWithSources_elements_sourceChannels(
sources: &NSArray<SCNGeometrySource>,
elements: Option<&NSArray<SCNGeometryElement>>,
source_channels: Option<&NSArray<NSNumber>>,
) -> Retained<Self>;
);
}