Trait SCNSceneRenderer

Source
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<&Block<dyn Fn() -> Bool + '_>>, ) -> bool where Self: Sized + Message { ... } unsafe fn prepareObjects_withCompletionHandler( &self, objects: &NSArray, completion_handler: Option<&Block<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 { ... }
}
Available on crate feature SCNSceneRenderer only.
Expand description

Protocol adopted by the various renderers (SCNView, SCNLayer, SCNRenderer)

See also Apple’s documentation

Provided Methods§

Source

unsafe fn scene(&self) -> Option<Retained<SCNScene>>
where Self: Sized + Message,

Available on crate feature SCNScene only.

Specifies the scene of the receiver.

Source

unsafe fn setScene(&self, scene: Option<&SCNScene>)
where Self: Sized + Message,

Available on crate feature SCNScene only.

Setter for scene.

Source

unsafe fn sceneTime(&self) -> NSTimeInterval
where Self: Sized + Message,

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.

Source

unsafe fn setSceneTime(&self, scene_time: NSTimeInterval)
where Self: Sized + Message,

Setter for sceneTime.

Source

unsafe fn delegate( &self, ) -> Option<Retained<ProtocolObject<dyn SCNSceneRendererDelegate>>>
where Self: Sized + Message,

Specifies the renderer delegate.

Source

unsafe fn setDelegate( &self, delegate: Option<&ProtocolObject<dyn SCNSceneRendererDelegate>>, )
where Self: Sized + Message,

This is a weak property. Setter for delegate.

Source

unsafe fn hitTest_options( &self, point: CGPoint, options: Option<&NSDictionary<SCNHitTestOption, AnyObject>>, ) -> Retained<NSArray<SCNHitTestResult>>
where Self: Sized + Message,

Available on crate features 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).

Source

unsafe fn isNodeInsideFrustum_withPointOfView( &self, node: &SCNNode, point_of_view: &SCNNode, ) -> bool
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn nodesInsideFrustumWithPointOfView( &self, point_of_view: &SCNNode, ) -> Retained<NSArray<SCNNode>>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn projectPoint(&self, point: SCNVector3) -> SCNVector3
where Self: Sized + Message,

Available on crate features 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’.

Source

unsafe fn unprojectPoint(&self, point: SCNVector3) -> SCNVector3
where Self: Sized + Message,

Available on crate features 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’.

Source

unsafe fn isPlaying(&self) -> bool
where Self: Sized + Message,

Returns YES if the scene is playing, NO otherwise.

Source

unsafe fn setPlaying(&self, playing: bool)
where Self: Sized + Message,

Setter for isPlaying.

Source

unsafe fn loops(&self) -> bool
where Self: Sized + Message,

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.

Source

unsafe fn setLoops(&self, loops: bool)
where Self: Sized + Message,

Setter for loops.

Source

unsafe fn pointOfView(&self) -> Option<Retained<SCNNode>>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn setPointOfView(&self, point_of_view: Option<&SCNNode>)
where Self: Sized + Message,

Available on crate feature SCNNode only.

Setter for pointOfView.

Source

unsafe fn autoenablesDefaultLighting(&self) -> bool
where Self: Sized + Message,

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.

Source

unsafe fn setAutoenablesDefaultLighting( &self, autoenables_default_lighting: bool, )
where Self: Sized + Message,

Source

unsafe fn isJitteringEnabled(&self) -> bool
where Self: Sized + Message,

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.

Source

unsafe fn setJitteringEnabled(&self, jittering_enabled: bool)
where Self: Sized + Message,

Setter for isJitteringEnabled.

Source

unsafe fn isTemporalAntialiasingEnabled(&self) -> bool
where Self: Sized + Message,

Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency. Defaults to NO.

Source

unsafe fn setTemporalAntialiasingEnabled( &self, temporal_antialiasing_enabled: bool, )
where Self: Sized + Message,

Source

unsafe fn prepareObject_shouldAbortBlock( &self, object: &AnyObject, block: Option<&Block<dyn Fn() -> Bool + '_>>, ) -> bool
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn prepareObjects_withCompletionHandler( &self, objects: &NSArray, completion_handler: Option<&Block<dyn Fn(Bool)>>, )
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn showsStatistics(&self) -> bool
where Self: Sized + Message,

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.

Source

unsafe fn setShowsStatistics(&self, shows_statistics: bool)
where Self: Sized + Message,

Setter for showsStatistics.

Source

unsafe fn debugOptions(&self) -> SCNDebugOptions
where Self: Sized + Message,

Specifies the debug options of the receiver. Defaults to SCNDebugOptionNone.

Source

unsafe fn setDebugOptions(&self, debug_options: SCNDebugOptions)
where Self: Sized + Message,

Setter for debugOptions.

Source

unsafe fn renderingAPI(&self) -> SCNRenderingAPI
where Self: Sized + Message,

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.

Source

unsafe fn workingColorSpace(&self) -> Retained<CGColorSpace>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn context(&self) -> *mut c_void
where Self: Sized + Message,

A Core OpenGL render context that is used as the render target (a CGLContextObj on macOS, an EAGLContext on iOS).

Source

unsafe fn currentRenderCommandEncoder( &self, ) -> Option<Retained<ProtocolObject<dyn MTLRenderCommandEncoder>>>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn currentRenderPassDescriptor( &self, ) -> Retained<MTLRenderPassDescriptor>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn device(&self) -> Option<Retained<ProtocolObject<dyn MTLDevice>>>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn colorPixelFormat(&self) -> MTLPixelFormat
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn depthPixelFormat(&self) -> MTLPixelFormat
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn stencilPixelFormat(&self) -> MTLPixelFormat
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn commandQueue( &self, ) -> Option<Retained<ProtocolObject<dyn MTLCommandQueue>>>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn audioEngine(&self) -> Retained<AVAudioEngine>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn audioEnvironmentNode(&self) -> Retained<AVAudioEnvironmentNode>
where Self: Sized + Message,

Available on crate feature objc2-avf-audio only.

Contains the instance of audio environment node used by the scene to spacialize sounds.

Source

unsafe fn audioListener(&self) -> Option<Retained<SCNNode>>
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn setAudioListener(&self, audio_listener: Option<&SCNNode>)
where Self: Sized + Message,

Available on crate feature SCNNode only.

Setter for audioListener.

Source

unsafe fn currentViewport(&self) -> CGRect
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn currentTime(&self) -> NSTimeInterval
where Self: Sized + Message,

👎Deprecated

Specifies the current time to display the scene.

Deprecated, use “sceneTime” instead.

Source

unsafe fn setCurrentTime(&self, current_time: NSTimeInterval)
where Self: Sized + Message,

👎Deprecated

Setter for currentTime.

Source

unsafe fn usesReverseZ(&self) -> bool
where Self: Sized + Message,

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.

Source

unsafe fn setUsesReverseZ(&self, uses_reverse_z: bool)
where Self: Sized + Message,

Setter for usesReverseZ.

Trait Implementations§

Source§

impl ProtocolType for dyn SCNSceneRenderer

Source§

const NAME: &'static str = "SCNSceneRenderer"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn SCNSceneRenderer

Implementations on Foreign Types§

Source§

impl<T> SCNSceneRenderer for ProtocolObject<T>
where T: ?Sized + SCNSceneRenderer,

Implementors§

Source§

impl SCNSceneRenderer for SCNLayer

Available on crate feature objc2-quartz-core and crate feature SCNLayer and non-watchOS only.
Source§

impl SCNSceneRenderer for SCNRenderer

Available on crate feature SCNRenderer only.
Source§

impl SCNSceneRenderer for SCNView

Available on crate feature objc2-app-kit and crate feature SCNView and macOS only.