pub unsafe trait SCNSceneRenderer: NSObjectProtocol {
Show 48 methods
// Provided methods
unsafe fn scene(&self) -> Option<Retained<SCNScene>>
where Self: Sized + Message { ... }
unsafe fn setScene(&self, scene: Option<&SCNScene>)
where Self: Sized + Message { ... }
unsafe fn sceneTime(&self) -> NSTimeInterval
where Self: Sized + Message { ... }
unsafe fn setSceneTime(&self, scene_time: NSTimeInterval)
where Self: Sized + Message { ... }
unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn SCNSceneRendererDelegate>>>
where Self: Sized + Message { ... }
unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn SCNSceneRendererDelegate>>,
)
where Self: Sized + Message { ... }
unsafe fn hitTest_options(
&self,
point: CGPoint,
options: Option<&NSDictionary<SCNHitTestOption, AnyObject>>,
) -> Retained<NSArray<SCNHitTestResult>>
where Self: Sized + Message { ... }
unsafe fn isNodeInsideFrustum_withPointOfView(
&self,
node: &SCNNode,
point_of_view: &SCNNode,
) -> bool
where Self: Sized + Message { ... }
unsafe fn nodesInsideFrustumWithPointOfView(
&self,
point_of_view: &SCNNode,
) -> Retained<NSArray<SCNNode>>
where Self: Sized + Message { ... }
unsafe fn projectPoint(&self, point: SCNVector3) -> SCNVector3
where Self: Sized + Message { ... }
unsafe fn unprojectPoint(&self, point: SCNVector3) -> SCNVector3
where Self: Sized + Message { ... }
unsafe fn isPlaying(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setPlaying(&self, playing: bool)
where Self: Sized + Message { ... }
unsafe fn loops(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setLoops(&self, loops: bool)
where Self: Sized + Message { ... }
unsafe fn pointOfView(&self) -> Option<Retained<SCNNode>>
where Self: Sized + Message { ... }
unsafe fn setPointOfView(&self, point_of_view: Option<&SCNNode>)
where Self: Sized + Message { ... }
unsafe fn autoenablesDefaultLighting(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setAutoenablesDefaultLighting(
&self,
autoenables_default_lighting: bool,
)
where Self: Sized + Message { ... }
unsafe fn isJitteringEnabled(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setJitteringEnabled(&self, jittering_enabled: bool)
where Self: Sized + Message { ... }
unsafe fn isTemporalAntialiasingEnabled(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setTemporalAntialiasingEnabled(
&self,
temporal_antialiasing_enabled: bool,
)
where Self: Sized + Message { ... }
unsafe fn prepareObject_shouldAbortBlock(
&self,
object: &AnyObject,
block: Option<&DynBlock<dyn Fn() -> Bool + '_>>,
) -> bool
where Self: Sized + Message { ... }
unsafe fn prepareObjects_withCompletionHandler(
&self,
objects: &NSArray,
completion_handler: Option<&DynBlock<dyn Fn(Bool)>>,
)
where Self: Sized + Message { ... }
unsafe fn showsStatistics(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setShowsStatistics(&self, shows_statistics: bool)
where Self: Sized + Message { ... }
unsafe fn debugOptions(&self) -> SCNDebugOptions
where Self: Sized + Message { ... }
unsafe fn setDebugOptions(&self, debug_options: SCNDebugOptions)
where Self: Sized + Message { ... }
unsafe fn renderingAPI(&self) -> SCNRenderingAPI
where Self: Sized + Message { ... }
unsafe fn workingColorSpace(&self) -> Retained<CGColorSpace>
where Self: Sized + Message { ... }
unsafe fn context(&self) -> *mut c_void
where Self: Sized + Message { ... }
unsafe fn currentRenderCommandEncoder(
&self,
) -> Option<Retained<ProtocolObject<dyn MTLRenderCommandEncoder>>>
where Self: Sized + Message { ... }
unsafe fn currentRenderPassDescriptor(
&self,
) -> Retained<MTLRenderPassDescriptor>
where Self: Sized + Message { ... }
unsafe fn device(&self) -> Option<Retained<ProtocolObject<dyn MTLDevice>>>
where Self: Sized + Message { ... }
unsafe fn colorPixelFormat(&self) -> MTLPixelFormat
where Self: Sized + Message { ... }
unsafe fn depthPixelFormat(&self) -> MTLPixelFormat
where Self: Sized + Message { ... }
unsafe fn stencilPixelFormat(&self) -> MTLPixelFormat
where Self: Sized + Message { ... }
unsafe fn commandQueue(
&self,
) -> Option<Retained<ProtocolObject<dyn MTLCommandQueue>>>
where Self: Sized + Message { ... }
unsafe fn audioEngine(&self) -> Retained<AVAudioEngine>
where Self: Sized + Message { ... }
unsafe fn audioEnvironmentNode(&self) -> Retained<AVAudioEnvironmentNode>
where Self: Sized + Message { ... }
unsafe fn audioListener(&self) -> Option<Retained<SCNNode>>
where Self: Sized + Message { ... }
unsafe fn setAudioListener(&self, audio_listener: Option<&SCNNode>)
where Self: Sized + Message { ... }
unsafe fn currentViewport(&self) -> CGRect
where Self: Sized + Message { ... }
unsafe fn currentTime(&self) -> NSTimeInterval
where Self: Sized + Message { ... }
unsafe fn setCurrentTime(&self, current_time: NSTimeInterval)
where Self: Sized + Message { ... }
unsafe fn usesReverseZ(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setUsesReverseZ(&self, uses_reverse_z: bool)
where Self: Sized + Message { ... }
}SCNSceneRenderer only.Expand description
Protocol adopted by the various renderers (SCNView, SCNLayer, SCNRenderer)
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn scene(&self) -> Option<Retained<SCNScene>>
Available on crate feature SCNScene only.
unsafe fn scene(&self) -> Option<Retained<SCNScene>>
SCNScene only.Specifies the scene of the receiver.
Sourceunsafe fn setScene(&self, scene: Option<&SCNScene>)
Available on crate feature SCNScene only.
unsafe fn setScene(&self, scene: Option<&SCNScene>)
SCNScene only.Setter for scene.
Sourceunsafe fn sceneTime(&self) -> NSTimeInterval
unsafe fn sceneTime(&self) -> NSTimeInterval
Specifies the current “scene time” to display the scene.
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.
Sourceunsafe fn setSceneTime(&self, scene_time: NSTimeInterval)
unsafe fn setSceneTime(&self, scene_time: NSTimeInterval)
Setter for sceneTime.
Sourceunsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn SCNSceneRendererDelegate>>>
unsafe fn delegate( &self, ) -> Option<Retained<ProtocolObject<dyn SCNSceneRendererDelegate>>>
Specifies the renderer delegate.
Sourceunsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn SCNSceneRendererDelegate>>,
)
unsafe fn setDelegate( &self, delegate: Option<&ProtocolObject<dyn SCNSceneRendererDelegate>>, )
This is a weak property.
Setter for delegate.
Sourceunsafe fn hitTest_options(
&self,
point: CGPoint,
options: Option<&NSDictionary<SCNHitTestOption, AnyObject>>,
) -> Retained<NSArray<SCNHitTestResult>>
Available on crate features SCNHitTest and objc2-core-foundation only.
unsafe fn hitTest_options( &self, point: CGPoint, options: Option<&NSDictionary<SCNHitTestOption, AnyObject>>, ) -> Retained<NSArray<SCNHitTestResult>>
SCNHitTest and objc2-core-foundation only.Returns an array of SCNHitTestResult for each node that contains a specified point.
Parameter point: A point in the coordinate system of the receiver.
Parameter options: Optional parameters (see the “Hit test options” group for the available options).
Sourceunsafe fn isNodeInsideFrustum_withPointOfView(
&self,
node: &SCNNode,
point_of_view: &SCNNode,
) -> bool
Available on crate feature SCNNode only.
unsafe fn isNodeInsideFrustum_withPointOfView( &self, node: &SCNNode, point_of_view: &SCNNode, ) -> bool
SCNNode only.Test whether node is visible from the specified point of view.
Parameter node: The node to test the visibility of.
Parameter pointOfView: The point of view used to test the visibility.
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.
Sourceunsafe fn nodesInsideFrustumWithPointOfView(
&self,
point_of_view: &SCNNode,
) -> Retained<NSArray<SCNNode>>
Available on crate feature SCNNode only.
unsafe fn nodesInsideFrustumWithPointOfView( &self, point_of_view: &SCNNode, ) -> Retained<NSArray<SCNNode>>
SCNNode only.Returns an array containing the nodes visible from the specified point of view.
Parameter pointOfView: The point of view used to test the visibility.
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.
Sourceunsafe fn projectPoint(&self, point: SCNVector3) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
unsafe fn projectPoint(&self, point: SCNVector3) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Projects a point in the world coordinate system using the receiver’s current point of view and viewport.
Parameter point: The world position to be projected.
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’.
Sourceunsafe fn unprojectPoint(&self, point: SCNVector3) -> SCNVector3
Available on crate features SceneKitTypes and objc2-core-foundation only.
unsafe fn unprojectPoint(&self, point: SCNVector3) -> SCNVector3
SceneKitTypes and objc2-core-foundation only.Unprojects a screenspace 2D point with depth info using the receiver’s current point of view and viewport.
Parameter point: The screenspace position to be unprojected.
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’.
Sourceunsafe fn loops(&self) -> bool
unsafe fn loops(&self) -> bool
Indicates whether the receiver restarts playback when it reaches the end of its content. Default: YES.
YES when the receiver restarts playback when it finishes, NO otherwise.
Sourceunsafe fn pointOfView(&self) -> Option<Retained<SCNNode>>
Available on crate feature SCNNode only.
unsafe fn pointOfView(&self) -> Option<Retained<SCNNode>>
SCNNode only.Specifies the point of view used to render the scene.
A point of view must have either a camera or a spot light attached.
Sourceunsafe fn setPointOfView(&self, point_of_view: Option<&SCNNode>)
Available on crate feature SCNNode only.
unsafe fn setPointOfView(&self, point_of_view: Option<&SCNNode>)
SCNNode only.Setter for pointOfView.
Sourceunsafe fn autoenablesDefaultLighting(&self) -> bool
unsafe fn autoenablesDefaultLighting(&self) -> bool
Specifies whether the receiver should automatically light up scenes that have no light source. The default is NO.
When enabled, a diffuse light is automatically added and placed while rendering scenes that have no light or only ambient lights.
Sourceunsafe fn setAutoenablesDefaultLighting(
&self,
autoenables_default_lighting: bool,
)
unsafe fn setAutoenablesDefaultLighting( &self, autoenables_default_lighting: bool, )
Setter for autoenablesDefaultLighting.
Sourceunsafe fn isJitteringEnabled(&self) -> bool
unsafe fn isJitteringEnabled(&self) -> bool
Specifies whether the receiver should jitter the rendered scene to reduce aliasing artifacts.
When enabled, the jittering is performed asynchronously and automatically by SCNView and SCNLayer. It is done synchronously by SCNRenderer.
Sourceunsafe fn setJitteringEnabled(&self, jittering_enabled: bool)
unsafe fn setJitteringEnabled(&self, jittering_enabled: bool)
Setter for isJitteringEnabled.
Sourceunsafe fn isTemporalAntialiasingEnabled(&self) -> bool
unsafe fn isTemporalAntialiasingEnabled(&self) -> bool
Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency. Defaults to NO.
Sourceunsafe fn setTemporalAntialiasingEnabled(
&self,
temporal_antialiasing_enabled: bool,
)
unsafe fn setTemporalAntialiasingEnabled( &self, temporal_antialiasing_enabled: bool, )
Setter for isTemporalAntialiasingEnabled.
Sourceunsafe fn prepareObject_shouldAbortBlock(
&self,
object: &AnyObject,
block: Option<&DynBlock<dyn Fn() -> Bool + '_>>,
) -> bool
Available on crate feature block2 only.
unsafe fn prepareObject_shouldAbortBlock( &self, object: &AnyObject, block: Option<&DynBlock<dyn Fn() -> Bool + '_>>, ) -> bool
block2 only.Prepare the specified object for drawing.
Parameter object: The object to prepare. It can be an instance of SCNScene, SCNNode, SCNGeometry, or SCNMaterial
Parameter block: This block will be called repeatedly while the object is prepared. Return YES if you want the operation to abort.
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.
Sourceunsafe fn prepareObjects_withCompletionHandler(
&self,
objects: &NSArray,
completion_handler: Option<&DynBlock<dyn Fn(Bool)>>,
)
Available on crate feature block2 only.
unsafe fn prepareObjects_withCompletionHandler( &self, objects: &NSArray, completion_handler: Option<&DynBlock<dyn Fn(Bool)>>, )
block2 only.Prepare the specified objects for drawing on the background.
Parameter objects: The objects to prepare. It can be one or more instances of SCNScene, SCNNode, SCNGeometry, or SCNMaterial
Parameter completionHandler: This block will be called when all objects has been prepared, or on failure.
This method is observable using NSProgress.
Sourceunsafe fn showsStatistics(&self) -> bool
unsafe fn showsStatistics(&self) -> bool
Determines whether the receiver should display statistics info like FPS. Defaults to NO.
When set to YES, statistics are displayed in a overlay on top of the rendered scene.
Sourceunsafe fn setShowsStatistics(&self, shows_statistics: bool)
unsafe fn setShowsStatistics(&self, shows_statistics: bool)
Setter for showsStatistics.
Sourceunsafe fn debugOptions(&self) -> SCNDebugOptions
unsafe fn debugOptions(&self) -> SCNDebugOptions
Specifies the debug options of the receiver. Defaults to SCNDebugOptionNone.
Sourceunsafe fn setDebugOptions(&self, debug_options: SCNDebugOptions)
unsafe fn setDebugOptions(&self, debug_options: SCNDebugOptions)
Setter for debugOptions.
Sourceunsafe fn renderingAPI(&self) -> SCNRenderingAPI
unsafe fn renderingAPI(&self) -> SCNRenderingAPI
Specifies the rendering API associated to the receiver.
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.
Sourceunsafe fn workingColorSpace(&self) -> Retained<CGColorSpace>
Available on crate feature objc2-core-graphics only.
unsafe fn workingColorSpace(&self) -> Retained<CGColorSpace>
objc2-core-graphics only.Specifies the color space used by the receiver for shading.
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.
Sourceunsafe fn context(&self) -> *mut c_void
unsafe fn context(&self) -> *mut c_void
A Core OpenGL render context that is used as the render target (a CGLContextObj on macOS, an EAGLContext on iOS).
Sourceunsafe fn currentRenderCommandEncoder(
&self,
) -> Option<Retained<ProtocolObject<dyn MTLRenderCommandEncoder>>>
Available on crate feature objc2-metal and non-watchOS only.
unsafe fn currentRenderCommandEncoder( &self, ) -> Option<Retained<ProtocolObject<dyn MTLRenderCommandEncoder>>>
objc2-metal and non-watchOS only.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.
Sourceunsafe fn currentRenderPassDescriptor(
&self,
) -> Retained<MTLRenderPassDescriptor>
Available on crate feature objc2-metal and non-watchOS only.
unsafe fn currentRenderPassDescriptor( &self, ) -> Retained<MTLRenderPassDescriptor>
objc2-metal and non-watchOS only.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.
Sourceunsafe fn device(&self) -> Option<Retained<ProtocolObject<dyn MTLDevice>>>
Available on crate feature objc2-metal and non-watchOS only.
unsafe fn device(&self) -> Option<Retained<ProtocolObject<dyn MTLDevice>>>
objc2-metal and non-watchOS only.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.
Sourceunsafe fn colorPixelFormat(&self) -> MTLPixelFormat
Available on crate feature objc2-metal and non-watchOS only.
unsafe fn colorPixelFormat(&self) -> MTLPixelFormat
objc2-metal and non-watchOS only.The pixel format of the color attachment 0 of the renderer. This property is only valid on a renderer created with a Metal device.
Sourceunsafe fn depthPixelFormat(&self) -> MTLPixelFormat
Available on crate feature objc2-metal and non-watchOS only.
unsafe fn depthPixelFormat(&self) -> MTLPixelFormat
objc2-metal and non-watchOS only.The pixel format of the depth attachment of the renderer. This property is only valid on a renderer created with a Metal device.
Sourceunsafe fn stencilPixelFormat(&self) -> MTLPixelFormat
Available on crate feature objc2-metal and non-watchOS only.
unsafe fn stencilPixelFormat(&self) -> MTLPixelFormat
objc2-metal and non-watchOS only.The pixel format of the stencil attachment of the renderer. This property is only valid on a renderer created with a Metal device.
Sourceunsafe fn commandQueue(
&self,
) -> Option<Retained<ProtocolObject<dyn MTLCommandQueue>>>
Available on crate feature objc2-metal and non-watchOS only.
unsafe fn commandQueue( &self, ) -> Option<Retained<ProtocolObject<dyn MTLCommandQueue>>>
objc2-metal and non-watchOS only.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.
Sourceunsafe fn audioEngine(&self) -> Retained<AVAudioEngine>
Available on crate feature objc2-avf-audio only.
unsafe fn audioEngine(&self) -> Retained<AVAudioEngine>
objc2-avf-audio only.Contains the instance of audio engine used by the scene.
The audio engine can be used to add custom nodes to the audio graph.
Sourceunsafe fn audioEnvironmentNode(&self) -> Retained<AVAudioEnvironmentNode>
Available on crate feature objc2-avf-audio only.
unsafe fn audioEnvironmentNode(&self) -> Retained<AVAudioEnvironmentNode>
objc2-avf-audio only.Contains the instance of audio environment node used by the scene to spacialize sounds.
Sourceunsafe fn audioListener(&self) -> Option<Retained<SCNNode>>
Available on crate feature SCNNode only.
unsafe fn audioListener(&self) -> Option<Retained<SCNNode>>
SCNNode only.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.
Sourceunsafe fn setAudioListener(&self, audio_listener: Option<&SCNNode>)
Available on crate feature SCNNode only.
unsafe fn setAudioListener(&self, audio_listener: Option<&SCNNode>)
SCNNode only.Setter for audioListener.
Sourceunsafe fn currentViewport(&self) -> CGRect
Available on crate feature objc2-core-foundation only.
unsafe fn currentViewport(&self) -> CGRect
objc2-core-foundation only.Returns the current viewport for this renderer, can be used to get the actual viewport from within the delegate callback during a live resize.
Sourceunsafe fn currentTime(&self) -> NSTimeInterval
👎Deprecated
unsafe fn currentTime(&self) -> NSTimeInterval
Specifies the current time to display the scene.
Deprecated, use “sceneTime” instead.
Sourceunsafe fn setCurrentTime(&self, current_time: NSTimeInterval)
👎Deprecated
unsafe fn setCurrentTime(&self, current_time: NSTimeInterval)
Setter for currentTime.
Sourceunsafe fn usesReverseZ(&self) -> bool
unsafe fn usesReverseZ(&self) -> bool
Specifies if the renderer should use the reverse Z technique. Defaults to YES.
This property is only valid on a renderer created with a Metal device.
Sourceunsafe fn setUsesReverseZ(&self, uses_reverse_z: bool)
unsafe fn setUsesReverseZ(&self, uses_reverse_z: bool)
Setter for usesReverseZ.
Trait Implementations§
Source§impl ProtocolType for dyn SCNSceneRenderer
impl ProtocolType for dyn SCNSceneRenderer
impl<T> ImplementedBy<T> for dyn SCNSceneRenderer
Implementations on Foreign Types§
impl<T> SCNSceneRenderer for ProtocolObject<T>where
T: ?Sized + SCNSceneRenderer,
Implementors§
impl SCNSceneRenderer for SCNLayer
SCNLayer only.impl SCNSceneRenderer for SCNRenderer
SCNRenderer only.impl SCNSceneRenderer for SCNView
SCNView only.