objc2_scene_kit/generated/SCNSceneRenderer.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-avf-audio")]
7use objc2_avf_audio::*;
8#[cfg(feature = "objc2-core-foundation")]
9use objc2_core_foundation::*;
10#[cfg(feature = "objc2-core-graphics")]
11use objc2_core_graphics::*;
12use objc2_foundation::*;
13#[cfg(feature = "objc2-metal")]
14#[cfg(not(target_os = "watchos"))]
15use objc2_metal::*;
16
17use crate::*;
18
19/// antialiasing modes for scene renderers
20///
21/// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnantialiasingmode?language=objc)
22// NS_ENUM
23#[repr(transparent)]
24#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
25pub struct SCNAntialiasingMode(pub NSUInteger);
26impl SCNAntialiasingMode {
27 #[doc(alias = "SCNAntialiasingModeNone")]
28 pub const None: Self = Self(0);
29 #[doc(alias = "SCNAntialiasingModeMultisampling2X")]
30 pub const Multisampling2X: Self = Self(1);
31 #[doc(alias = "SCNAntialiasingModeMultisampling4X")]
32 pub const Multisampling4X: Self = Self(2);
33 #[doc(alias = "SCNAntialiasingModeMultisampling8X")]
34 pub const Multisampling8X: Self = Self(3);
35 #[doc(alias = "SCNAntialiasingModeMultisampling16X")]
36 pub const Multisampling16X: Self = Self(4);
37}
38
39unsafe impl Encode for SCNAntialiasingMode {
40 const ENCODING: Encoding = NSUInteger::ENCODING;
41}
42
43unsafe impl RefEncode for SCNAntialiasingMode {
44 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
45}
46
47/// rendering API used by SCNView and SCNRenderer.
48///
49/// Default preferred API is SCNRenderingAPIMetal on iOS and it depends on the configuration on macOS.
50/// If Metal is requested but not available then it fallbacks to SCNRenderingAPIOpenGLES2 on iOS and to SCNRenderingAPIOpenGLLegacy on macOS.
51///
52/// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnrenderingapi?language=objc)
53// NS_ENUM
54#[repr(transparent)]
55#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
56pub struct SCNRenderingAPI(pub NSUInteger);
57impl SCNRenderingAPI {
58 #[doc(alias = "SCNRenderingAPIMetal")]
59 pub const Metal: Self = Self(0);
60 #[doc(alias = "SCNRenderingAPIOpenGLLegacy")]
61 pub const OpenGLLegacy: Self = Self(1);
62 #[doc(alias = "SCNRenderingAPIOpenGLCore32")]
63 pub const OpenGLCore32: Self = Self(2);
64 #[doc(alias = "SCNRenderingAPIOpenGLCore41")]
65 pub const OpenGLCore41: Self = Self(3);
66}
67
68unsafe impl Encode for SCNRenderingAPI {
69 const ENCODING: Encoding = NSUInteger::ENCODING;
70}
71
72unsafe impl RefEncode for SCNRenderingAPI {
73 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
74}
75
76/// Debug options.
77///
78/// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scndebugoptions?language=objc)
79// NS_OPTIONS
80#[repr(transparent)]
81#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
82pub struct SCNDebugOptions(pub NSUInteger);
83bitflags::bitflags! {
84 impl SCNDebugOptions: NSUInteger {
85 #[doc(alias = "SCNDebugOptionNone")]
86 const None = 0;
87 #[doc(alias = "SCNDebugOptionShowPhysicsShapes")]
88 const ShowPhysicsShapes = 1<<0;
89 #[doc(alias = "SCNDebugOptionShowBoundingBoxes")]
90 const ShowBoundingBoxes = 1<<1;
91 #[doc(alias = "SCNDebugOptionShowLightInfluences")]
92 const ShowLightInfluences = 1<<2;
93 #[doc(alias = "SCNDebugOptionShowLightExtents")]
94 const ShowLightExtents = 1<<3;
95 #[doc(alias = "SCNDebugOptionShowPhysicsFields")]
96 const ShowPhysicsFields = 1<<4;
97 #[doc(alias = "SCNDebugOptionShowWireframe")]
98 const ShowWireframe = 1<<5;
99 #[doc(alias = "SCNDebugOptionRenderAsWireframe")]
100 const RenderAsWireframe = 1<<6;
101 #[doc(alias = "SCNDebugOptionShowSkeletons")]
102 const ShowSkeletons = 1<<7;
103 #[doc(alias = "SCNDebugOptionShowCreases")]
104 const ShowCreases = 1<<8;
105 #[doc(alias = "SCNDebugOptionShowConstraints")]
106 const ShowConstraints = 1<<9;
107 #[doc(alias = "SCNDebugOptionShowCameras")]
108 const ShowCameras = 1<<10;
109 }
110}
111
112unsafe impl Encode for SCNDebugOptions {
113 const ENCODING: Encoding = NSUInteger::ENCODING;
114}
115
116unsafe impl RefEncode for SCNDebugOptions {
117 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
118}
119
120extern_protocol!(
121 /// Protocol adopted by the various renderers (SCNView, SCNLayer, SCNRenderer)
122 ///
123 /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnscenerenderer?language=objc)
124 pub unsafe trait SCNSceneRenderer: NSObjectProtocol {
125 #[cfg(feature = "SCNScene")]
126 /// Specifies the scene of the receiver.
127 #[unsafe(method(scene))]
128 #[unsafe(method_family = none)]
129 unsafe fn scene(&self) -> Option<Retained<SCNScene>>;
130
131 #[cfg(feature = "SCNScene")]
132 /// Setter for [`scene`][Self::scene].
133 #[unsafe(method(setScene:))]
134 #[unsafe(method_family = none)]
135 unsafe fn setScene(&self, scene: Option<&SCNScene>);
136
137 /// Specifies the current "scene time" to display the scene.
138 ///
139 /// 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.
140 #[unsafe(method(sceneTime))]
141 #[unsafe(method_family = none)]
142 unsafe fn sceneTime(&self) -> NSTimeInterval;
143
144 /// Setter for [`sceneTime`][Self::sceneTime].
145 #[unsafe(method(setSceneTime:))]
146 #[unsafe(method_family = none)]
147 unsafe fn setSceneTime(&self, scene_time: NSTimeInterval);
148
149 /// Specifies the renderer delegate.
150 #[unsafe(method(delegate))]
151 #[unsafe(method_family = none)]
152 unsafe fn delegate(&self)
153 -> Option<Retained<ProtocolObject<dyn SCNSceneRendererDelegate>>>;
154
155 /// Setter for [`delegate`][Self::delegate].
156 ///
157 /// This is a [weak property][objc2::topics::weak_property].
158 #[unsafe(method(setDelegate:))]
159 #[unsafe(method_family = none)]
160 unsafe fn setDelegate(
161 &self,
162 delegate: Option<&ProtocolObject<dyn SCNSceneRendererDelegate>>,
163 );
164
165 #[cfg(all(feature = "SCNHitTest", feature = "objc2-core-foundation"))]
166 /// Returns an array of SCNHitTestResult for each node that contains a specified point.
167 ///
168 /// Parameter `point`: A point in the coordinate system of the receiver.
169 ///
170 /// Parameter `options`: Optional parameters (see the "Hit test options" group for the available options).
171 ///
172 /// # Safety
173 ///
174 /// `options` generic should be of the correct type.
175 #[unsafe(method(hitTest:options:))]
176 #[unsafe(method_family = none)]
177 unsafe fn hitTest_options(
178 &self,
179 point: CGPoint,
180 options: Option<&NSDictionary<SCNHitTestOption, AnyObject>>,
181 ) -> Retained<NSArray<SCNHitTestResult>>;
182
183 #[cfg(feature = "SCNNode")]
184 /// Test whether node is visible from the specified point of view.
185 ///
186 /// Parameter `node`: The node to test the visibility of.
187 ///
188 /// Parameter `pointOfView`: The point of view used to test the visibility.
189 ///
190 /// 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.
191 #[unsafe(method(isNodeInsideFrustum:withPointOfView:))]
192 #[unsafe(method_family = none)]
193 unsafe fn isNodeInsideFrustum_withPointOfView(
194 &self,
195 node: &SCNNode,
196 point_of_view: &SCNNode,
197 ) -> bool;
198
199 #[cfg(feature = "SCNNode")]
200 /// Returns an array containing the nodes visible from the specified point of view.
201 ///
202 /// Parameter `pointOfView`: The point of view used to test the visibility.
203 ///
204 /// 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.
205 #[unsafe(method(nodesInsideFrustumWithPointOfView:))]
206 #[unsafe(method_family = none)]
207 unsafe fn nodesInsideFrustumWithPointOfView(
208 &self,
209 point_of_view: &SCNNode,
210 ) -> Retained<NSArray<SCNNode>>;
211
212 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
213 /// Projects a point in the world coordinate system using the receiver's current point of view and viewport.
214 ///
215 /// Parameter `point`: The world position to be projected.
216 ///
217 /// A point projected from the near (resp. far) clip plane will have a z component of 0 (resp. 1). Starting in macOS 11.0, iOS 14, tvOS 14 and watchOS 7 the range of z component will be reversed (from 1 to 0) if the receiver uses 'reverseZ'.
218 #[unsafe(method(projectPoint:))]
219 #[unsafe(method_family = none)]
220 unsafe fn projectPoint(&self, point: SCNVector3) -> SCNVector3;
221
222 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
223 /// Unprojects a screenspace 2D point with depth info using the receiver's current point of view and viewport.
224 ///
225 /// Parameter `point`: The screenspace position to be unprojected.
226 ///
227 /// A point whose z component is 0 (resp. 1) is unprojected on the near (resp. far) clip plane. Starting in macOS 11.0, iOS 14, tvOS 14 and watchOS 7 the range of the z component will be reversed (from 1 to 0) if the receiver uses 'reverseZ'.
228 #[unsafe(method(unprojectPoint:))]
229 #[unsafe(method_family = none)]
230 unsafe fn unprojectPoint(&self, point: SCNVector3) -> SCNVector3;
231
232 /// Returns YES if the scene is playing, NO otherwise.
233 #[unsafe(method(isPlaying))]
234 #[unsafe(method_family = none)]
235 unsafe fn isPlaying(&self) -> bool;
236
237 /// Setter for [`isPlaying`][Self::isPlaying].
238 #[unsafe(method(setPlaying:))]
239 #[unsafe(method_family = none)]
240 unsafe fn setPlaying(&self, playing: bool);
241
242 /// Indicates whether the receiver restarts playback when it reaches the end of its content. Default: YES.
243 ///
244 /// YES when the receiver restarts playback when it finishes, NO otherwise.
245 #[unsafe(method(loops))]
246 #[unsafe(method_family = none)]
247 unsafe fn loops(&self) -> bool;
248
249 /// Setter for [`loops`][Self::loops].
250 #[unsafe(method(setLoops:))]
251 #[unsafe(method_family = none)]
252 unsafe fn setLoops(&self, loops: bool);
253
254 #[cfg(feature = "SCNNode")]
255 /// Specifies the point of view used to render the scene.
256 ///
257 /// A point of view must have either a camera or a spot light attached.
258 #[unsafe(method(pointOfView))]
259 #[unsafe(method_family = none)]
260 unsafe fn pointOfView(&self) -> Option<Retained<SCNNode>>;
261
262 #[cfg(feature = "SCNNode")]
263 /// Setter for [`pointOfView`][Self::pointOfView].
264 #[unsafe(method(setPointOfView:))]
265 #[unsafe(method_family = none)]
266 unsafe fn setPointOfView(&self, point_of_view: Option<&SCNNode>);
267
268 /// Specifies whether the receiver should automatically light up scenes that have no light source. The default is NO.
269 ///
270 /// When enabled, a diffuse light is automatically added and placed while rendering scenes that have no light or only ambient lights.
271 #[unsafe(method(autoenablesDefaultLighting))]
272 #[unsafe(method_family = none)]
273 unsafe fn autoenablesDefaultLighting(&self) -> bool;
274
275 /// Setter for [`autoenablesDefaultLighting`][Self::autoenablesDefaultLighting].
276 #[unsafe(method(setAutoenablesDefaultLighting:))]
277 #[unsafe(method_family = none)]
278 unsafe fn setAutoenablesDefaultLighting(&self, autoenables_default_lighting: bool);
279
280 /// Specifies whether the receiver should jitter the rendered scene to reduce aliasing artifacts.
281 ///
282 /// When enabled, the jittering is performed asynchronously and automatically by SCNView and SCNLayer. It is done synchronously by SCNRenderer.
283 #[unsafe(method(isJitteringEnabled))]
284 #[unsafe(method_family = none)]
285 unsafe fn isJitteringEnabled(&self) -> bool;
286
287 /// Setter for [`isJitteringEnabled`][Self::isJitteringEnabled].
288 #[unsafe(method(setJitteringEnabled:))]
289 #[unsafe(method_family = none)]
290 unsafe fn setJitteringEnabled(&self, jittering_enabled: bool);
291
292 /// Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency. Defaults to NO.
293 #[unsafe(method(isTemporalAntialiasingEnabled))]
294 #[unsafe(method_family = none)]
295 unsafe fn isTemporalAntialiasingEnabled(&self) -> bool;
296
297 /// Setter for [`isTemporalAntialiasingEnabled`][Self::isTemporalAntialiasingEnabled].
298 #[unsafe(method(setTemporalAntialiasingEnabled:))]
299 #[unsafe(method_family = none)]
300 unsafe fn setTemporalAntialiasingEnabled(&self, temporal_antialiasing_enabled: bool);
301
302 #[cfg(feature = "block2")]
303 /// Prepare the specified object for drawing.
304 ///
305 /// Parameter `object`: The object to prepare. It can be an instance of SCNScene, SCNNode, SCNGeometry, or SCNMaterial
306 ///
307 /// Parameter `block`: This block will be called repeatedly while the object is prepared. Return YES if you want the operation to abort.
308 ///
309 /// 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.
310 ///
311 /// # Safety
312 ///
313 /// `object` should be of the correct type.
314 #[unsafe(method(prepareObject:shouldAbortBlock:))]
315 #[unsafe(method_family = none)]
316 unsafe fn prepareObject_shouldAbortBlock(
317 &self,
318 object: &AnyObject,
319 block: Option<&block2::DynBlock<dyn Fn() -> Bool + '_>>,
320 ) -> bool;
321
322 #[cfg(feature = "block2")]
323 /// Prepare the specified objects for drawing on the background.
324 ///
325 /// Parameter `objects`: The objects to prepare. It can be one or more instances of SCNScene, SCNNode, SCNGeometry, or SCNMaterial
326 ///
327 /// Parameter `completionHandler`: This block will be called when all objects has been prepared, or on failure.
328 ///
329 /// This method is observable using NSProgress.
330 ///
331 /// # Safety
332 ///
333 /// `objects` generic should be of the correct type.
334 #[unsafe(method(prepareObjects:withCompletionHandler:))]
335 #[unsafe(method_family = none)]
336 unsafe fn prepareObjects_withCompletionHandler(
337 &self,
338 objects: &NSArray,
339 completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
340 );
341
342 /// Determines whether the receiver should display statistics info like FPS. Defaults to NO.
343 ///
344 /// When set to YES, statistics are displayed in a overlay on top of the rendered scene.
345 #[unsafe(method(showsStatistics))]
346 #[unsafe(method_family = none)]
347 unsafe fn showsStatistics(&self) -> bool;
348
349 /// Setter for [`showsStatistics`][Self::showsStatistics].
350 #[unsafe(method(setShowsStatistics:))]
351 #[unsafe(method_family = none)]
352 unsafe fn setShowsStatistics(&self, shows_statistics: bool);
353
354 /// Specifies the debug options of the receiver. Defaults to SCNDebugOptionNone.
355 #[unsafe(method(debugOptions))]
356 #[unsafe(method_family = none)]
357 unsafe fn debugOptions(&self) -> SCNDebugOptions;
358
359 /// Setter for [`debugOptions`][Self::debugOptions].
360 #[unsafe(method(setDebugOptions:))]
361 #[unsafe(method_family = none)]
362 unsafe fn setDebugOptions(&self, debug_options: SCNDebugOptions);
363
364 /// Specifies the rendering API associated to the receiver.
365 ///
366 /// 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.
367 #[unsafe(method(renderingAPI))]
368 #[unsafe(method_family = none)]
369 unsafe fn renderingAPI(&self) -> SCNRenderingAPI;
370
371 #[cfg(feature = "objc2-core-graphics")]
372 /// Specifies the color space used by the receiver for shading.
373 ///
374 /// SceneKit will automatically color match image and color objects (NSImage, NSColor, CGImageRef, CGColorRef, etc.). When you directly provide color components to shaders, use this property to color match them to the working color space.
375 #[unsafe(method(workingColorSpace))]
376 #[unsafe(method_family = none)]
377 unsafe fn workingColorSpace(&self) -> Retained<CGColorSpace>;
378
379 /// A Core OpenGL render context that is used as the render target (a CGLContextObj on macOS, an EAGLContext on iOS).
380 #[unsafe(method(context))]
381 #[unsafe(method_family = none)]
382 unsafe fn context(&self) -> *mut c_void;
383
384 #[cfg(feature = "objc2-metal")]
385 #[cfg(not(target_os = "watchos"))]
386 /// The current render command encoder if any. This property is only valid within the SCNSceneRendererDelegate methods and when rendering with Metal. Otherwise it is set to nil.
387 #[unsafe(method(currentRenderCommandEncoder))]
388 #[unsafe(method_family = none)]
389 unsafe fn currentRenderCommandEncoder(
390 &self,
391 ) -> Option<Retained<ProtocolObject<dyn MTLRenderCommandEncoder>>>;
392
393 #[cfg(feature = "objc2-metal")]
394 #[cfg(not(target_os = "watchos"))]
395 /// The render pass descriptor of the receiver. This property is only valid within the SCNSceneRendererDelegate methods and when rendering with Metal. Otherwise it is set to nil.
396 #[unsafe(method(currentRenderPassDescriptor))]
397 #[unsafe(method_family = none)]
398 unsafe fn currentRenderPassDescriptor(&self) -> Retained<MTLRenderPassDescriptor>;
399
400 #[cfg(feature = "objc2-metal")]
401 #[cfg(not(target_os = "watchos"))]
402 /// 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.
403 #[unsafe(method(device))]
404 #[unsafe(method_family = none)]
405 unsafe fn device(&self) -> Option<Retained<ProtocolObject<dyn MTLDevice>>>;
406
407 #[cfg(feature = "objc2-metal")]
408 #[cfg(not(target_os = "watchos"))]
409 /// The pixel format of the color attachment 0 of the renderer. This property is only valid on a renderer created with a Metal device.
410 #[unsafe(method(colorPixelFormat))]
411 #[unsafe(method_family = none)]
412 unsafe fn colorPixelFormat(&self) -> MTLPixelFormat;
413
414 #[cfg(feature = "objc2-metal")]
415 #[cfg(not(target_os = "watchos"))]
416 /// The pixel format of the depth attachment of the renderer. This property is only valid on a renderer created with a Metal device.
417 #[unsafe(method(depthPixelFormat))]
418 #[unsafe(method_family = none)]
419 unsafe fn depthPixelFormat(&self) -> MTLPixelFormat;
420
421 #[cfg(feature = "objc2-metal")]
422 #[cfg(not(target_os = "watchos"))]
423 /// The pixel format of the stencil attachment of the renderer. This property is only valid on a renderer created with a Metal device.
424 #[unsafe(method(stencilPixelFormat))]
425 #[unsafe(method_family = none)]
426 unsafe fn stencilPixelFormat(&self) -> MTLPixelFormat;
427
428 #[cfg(feature = "objc2-metal")]
429 #[cfg(not(target_os = "watchos"))]
430 /// 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.
431 #[unsafe(method(commandQueue))]
432 #[unsafe(method_family = none)]
433 unsafe fn commandQueue(&self) -> Option<Retained<ProtocolObject<dyn MTLCommandQueue>>>;
434
435 #[cfg(feature = "objc2-avf-audio")]
436 /// Contains the instance of audio engine used by the scene.
437 ///
438 /// The audio engine can be used to add custom nodes to the audio graph.
439 #[unsafe(method(audioEngine))]
440 #[unsafe(method_family = none)]
441 unsafe fn audioEngine(&self) -> Retained<AVAudioEngine>;
442
443 #[cfg(feature = "objc2-avf-audio")]
444 /// Contains the instance of audio environment node used by the scene to spacialize sounds.
445 #[unsafe(method(audioEnvironmentNode))]
446 #[unsafe(method_family = none)]
447 unsafe fn audioEnvironmentNode(&self) -> Retained<AVAudioEnvironmentNode>;
448
449 #[cfg(feature = "SCNNode")]
450 /// 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.
451 #[unsafe(method(audioListener))]
452 #[unsafe(method_family = none)]
453 unsafe fn audioListener(&self) -> Option<Retained<SCNNode>>;
454
455 #[cfg(feature = "SCNNode")]
456 /// Setter for [`audioListener`][Self::audioListener].
457 #[unsafe(method(setAudioListener:))]
458 #[unsafe(method_family = none)]
459 unsafe fn setAudioListener(&self, audio_listener: Option<&SCNNode>);
460
461 #[cfg(feature = "objc2-core-foundation")]
462 /// Returns the current viewport for this renderer, can be used to get the actual viewport from within the delegate callback during a live resize.
463 #[unsafe(method(currentViewport))]
464 #[unsafe(method_family = none)]
465 unsafe fn currentViewport(&self) -> CGRect;
466
467 /// Specifies the current time to display the scene.
468 ///
469 /// Deprecated, use "sceneTime" instead.
470 #[deprecated]
471 #[unsafe(method(currentTime))]
472 #[unsafe(method_family = none)]
473 unsafe fn currentTime(&self) -> NSTimeInterval;
474
475 /// Setter for [`currentTime`][Self::currentTime].
476 #[deprecated]
477 #[unsafe(method(setCurrentTime:))]
478 #[unsafe(method_family = none)]
479 unsafe fn setCurrentTime(&self, current_time: NSTimeInterval);
480
481 /// Specifies if the renderer should use the reverse Z technique. Defaults to YES.
482 ///
483 /// This property is only valid on a renderer created with a Metal device.
484 #[unsafe(method(usesReverseZ))]
485 #[unsafe(method_family = none)]
486 unsafe fn usesReverseZ(&self) -> bool;
487
488 /// Setter for [`usesReverseZ`][Self::usesReverseZ].
489 #[unsafe(method(setUsesReverseZ:))]
490 #[unsafe(method_family = none)]
491 unsafe fn setUsesReverseZ(&self, uses_reverse_z: bool);
492 }
493);
494
495extern_protocol!(
496 /// Implement this protocol to perform operations at various times during the rendering
497 ///
498 /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnscenerendererdelegate?language=objc)
499 pub unsafe trait SCNSceneRendererDelegate: NSObjectProtocol {
500 /// 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.
501 ///
502 /// Parameter `renderer`: The renderer that will render the scene.
503 ///
504 /// Parameter `time`: The time at which to update the scene.
505 ///
506 /// All modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
507 #[optional]
508 #[unsafe(method(renderer:updateAtTime:))]
509 #[unsafe(method_family = none)]
510 unsafe fn renderer_updateAtTime(
511 &self,
512 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
513 time: NSTimeInterval,
514 );
515
516 /// Invoked on the delegate once the scene renderer did apply the animations.
517 ///
518 /// Parameter `renderer`: The renderer that did render the scene.
519 ///
520 /// Parameter `time`: The time at which the animations were applied.
521 ///
522 /// All modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
523 #[optional]
524 #[unsafe(method(renderer:didApplyAnimationsAtTime:))]
525 #[unsafe(method_family = none)]
526 unsafe fn renderer_didApplyAnimationsAtTime(
527 &self,
528 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
529 time: NSTimeInterval,
530 );
531
532 /// Invoked on the delegate once the scene renderer did simulate the physics.
533 ///
534 /// Parameter `renderer`: The renderer that did render the scene.
535 ///
536 /// Parameter `time`: The time at which the physics were simulated.
537 ///
538 /// All modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
539 #[optional]
540 #[unsafe(method(renderer:didSimulatePhysicsAtTime:))]
541 #[unsafe(method_family = none)]
542 unsafe fn renderer_didSimulatePhysicsAtTime(
543 &self,
544 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
545 time: NSTimeInterval,
546 );
547
548 /// Invoked on the delegate once the scene renderer did apply the constraints.
549 ///
550 /// Parameter `renderer`: The renderer that did render the scene.
551 ///
552 /// Parameter `time`: The time at which the constraints were simulated.
553 ///
554 /// All modifications done within this method don't go through the transaction model, they are directly applied on the presentation tree.
555 #[optional]
556 #[unsafe(method(renderer:didApplyConstraintsAtTime:))]
557 #[unsafe(method_family = none)]
558 unsafe fn renderer_didApplyConstraintsAtTime(
559 &self,
560 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
561 time: NSTimeInterval,
562 );
563
564 #[cfg(feature = "SCNScene")]
565 /// Invoked on the delegate before the scene renderer renders the scene. At this point the openGL context and the destination framebuffer are bound.
566 ///
567 /// Parameter `renderer`: The renderer that will render the scene.
568 ///
569 /// Parameter `scene`: The scene to be rendered.
570 ///
571 /// Parameter `time`: The time at which the scene is to be rendered.
572 ///
573 /// 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.
574 #[optional]
575 #[unsafe(method(renderer:willRenderScene:atTime:))]
576 #[unsafe(method_family = none)]
577 unsafe fn renderer_willRenderScene_atTime(
578 &self,
579 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
580 scene: &SCNScene,
581 time: NSTimeInterval,
582 );
583
584 #[cfg(feature = "SCNScene")]
585 /// Invoked on the delegate once the scene renderer did render the scene.
586 ///
587 /// Parameter `renderer`: The renderer that did render the scene.
588 ///
589 /// Parameter `scene`: The rendered scene.
590 ///
591 /// Parameter `time`: The time at which the scene was rendered.
592 ///
593 /// 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.
594 #[optional]
595 #[unsafe(method(renderer:didRenderScene:atTime:))]
596 #[unsafe(method_family = none)]
597 unsafe fn renderer_didRenderScene_atTime(
598 &self,
599 renderer: &ProtocolObject<dyn SCNSceneRenderer>,
600 scene: &SCNScene,
601 time: NSTimeInterval,
602 );
603 }
604);