Package apple.scenekit.protocol
Interface SCNSceneRenderer
-
- All Known Implementing Classes:
ARSCNView,SCNRenderer,SCNView
public interface SCNSceneRenderer[@protocol] SCNSceneRenderer Protocol adopted by the various renderers (SCNView, SCNLayer, SCNRenderer)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSCNSceneRenderer.Block_prepareObjectShouldAbortBlockstatic interfaceSCNSceneRenderer.Block_prepareObjectsWithCompletionHandlerstatic interfaceSCNSceneRenderer.Block_presentSceneWithTransitionIncomingPointOfViewCompletionHandler
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull AVAudioEngineaudioEngine()[@property] audioEngine Contains the instance of audio engine used by the scene.@NotNull AVAudioEnvironmentNodeaudioEnvironmentNode()[@property] audioEnvironmentNode Contains the instance of audio environment node used by the scene to spacialize sounds.@Nullable SCNNodeaudioListener()[@property] audioListener Use this property to set the audio node to use as the listener position and orientation when rendering positional audio for this scene.booleanautoenablesDefaultLighting()[@property] autoenablesDefaultLighting Specifies whether the receiver should automatically light up scenes that have no light source.longcolorPixelFormat()[@property] colorPixelFormat The pixel format of the color attachment 0 of the renderer.@Nullable MTLCommandQueuecommandQueue()[@property] commandQueue The command queue of the renderer.@Nullable org.moe.natj.general.ptr.VoidPtrcontext()[@property] context A Core OpenGL render context that is used as the render target (a CGLContextObj on macOS, an EAGLContext on iOS).@Nullable MTLRenderCommandEncodercurrentRenderCommandEncoder()[@property] currentRenderCommandEncoder The current render command encoder if any.@NotNull MTLRenderPassDescriptorcurrentRenderPassDescriptor()[@property] currentRenderPassDescriptor The render pass descriptor of the receiver.CGRectcurrentViewport()[@property] currentViewport Returns the current viewport for this renderer, can be used to get the actual viewport from within the delegate callback during a live resize.longdebugOptions()[@property] debugOptions Specifies the debug options of the receiver.@Nullable java.lang.Objectdelegate()[@property] delegate Specifies the renderer delegate.longdepthPixelFormat()[@property] depthPixelFormat The pixel format of the depth attachment of the renderer.@Nullable MTLDevicedevice()[@property] device The metal device of the renderer.@NotNull NSArray<? extends SCNHitTestResult>hitTestOptions(CGPoint point, @Nullable NSDictionary<java.lang.String,?> options)hitTest:options: Returns an array of SCNHitTestResult for each node that contains a specified point.booleanisJitteringEnabled()[@property] jitteringEnabled Specifies whether the receiver should jitter the rendered scene to reduce aliasing artifacts.booleanisNodeInsideFrustumWithPointOfView(@NotNull SCNNode node, @NotNull SCNNode pointOfView)isNodeInsideFrustum:withPointOfView: Test whether node is visible from the specified point of view.booleanisPlaying()[@property] playing Returns YES if the scene is playing, NO otherwise.booleanisTemporalAntialiasingEnabled()[@property] temporalAntialiasingEnabled Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency.booleanloops()[@property] loops Indicates whether the receiver restarts playback when it reaches the end of its content.@NotNull NSArray<? extends SCNNode>nodesInsideFrustumWithPointOfView(@NotNull SCNNode pointOfView)nodesInsideFrustumWithPointOfView: Returns an array containing the nodes visible from the specified point of view.@Nullable SKSceneoverlaySKScene()[@property] overlaySKScene Specifies the overlay of the receiver as a SpriteKit scene instance.@Nullable SCNNodepointOfView()[@property] pointOfView Specifies the point of view used to render the scene.booleanprepareObjectShouldAbortBlock(@NotNull java.lang.Object object, @Nullable SCNSceneRenderer.Block_prepareObjectShouldAbortBlock block)prepareObject:shouldAbortBlock: Prepare the specified object for drawing.voidprepareObjectsWithCompletionHandler(@NotNull NSArray<?> objects, @Nullable SCNSceneRenderer.Block_prepareObjectsWithCompletionHandler completionHandler)prepareObjects:withCompletionHandler: Prepare the specified objects for drawing on the background.voidpresentSceneWithTransitionIncomingPointOfViewCompletionHandler(@NotNull SCNScene scene, @NotNull SKTransition transition, @Nullable SCNNode pointOfView, @Nullable SCNSceneRenderer.Block_presentSceneWithTransitionIncomingPointOfViewCompletionHandler completionHandler)presentScene:withTransition:incomingPointOfView: Present a SCNScene in the receiver, replacing the current scene.SCNVector3projectPoint(SCNVector3 point)projectPoint Projects a point in the world coordinate system using the receiver's current point of view and viewport.longrenderingAPI()[@property] renderingAPI Specifies the rendering API associated to the receiver.@Nullable SCNScenescene()[@property] scene Specifies the scene of the receiver.doublesceneTime()[@property] sceneTime Specifies the current "scene time" to display the scene.voidsetAudioListener(@Nullable SCNNode value)[@property] audioListener Use this property to set the audio node to use as the listener position and orientation when rendering positional audio for this scene.voidsetAutoenablesDefaultLighting(boolean value)[@property] autoenablesDefaultLighting Specifies whether the receiver should automatically light up scenes that have no light source.voidsetDebugOptions(long value)[@property] debugOptions Specifies the debug options of the receiver.voidsetDelegate_unsafe(@Nullable java.lang.Object value)[@property] delegate Specifies the renderer delegate.voidsetJitteringEnabled(boolean value)[@property] jitteringEnabled Specifies whether the receiver should jitter the rendered scene to reduce aliasing artifacts.voidsetLoops(boolean value)[@property] loops Indicates whether the receiver restarts playback when it reaches the end of its content.voidsetOverlaySKScene(@Nullable SKScene value)[@property] overlaySKScene Specifies the overlay of the receiver as a SpriteKit scene instance.voidsetPlaying(boolean value)[@property] playing Returns YES if the scene is playing, NO otherwise.voidsetPointOfView(@Nullable SCNNode value)[@property] pointOfView Specifies the point of view used to render the scene.voidsetScene(@Nullable SCNScene value)[@property] scene Specifies the scene of the receiver.voidsetSceneTime(double value)[@property] sceneTime Specifies the current "scene time" to display the scene.voidsetShowsStatistics(boolean value)[@property] showsStatistics Determines whether the receiver should display statistics info like FPS.voidsetTemporalAntialiasingEnabled(boolean value)[@property] temporalAntialiasingEnabled Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency.voidsetUsesReverseZ(boolean value)[@property] usesReverseZ Specifies if the renderer should use the reverse Z technique.booleanshowsStatistics()[@property] showsStatistics Determines whether the receiver should display statistics info like FPS.longstencilPixelFormat()[@property] stencilPixelFormat The pixel format of the stencil attachment of the renderer.SCNVector3unprojectPoint(SCNVector3 point)unprojectPoint Unprojects a screenspace 2D point with depth info using the receiver's current point of view and viewport.booleanusesReverseZ()[@property] usesReverseZ Specifies if the renderer should use the reverse Z technique.@NotNull CGColorSpaceRefworkingColorSpace()[@property] workingColorSpace Specifies the color space used by the receiver for shading.
-
-
-
Method Detail
-
audioEngine
@NotNull @NotNull AVAudioEngine audioEngine()
[@property] audioEngine Contains the instance of audio engine used by the scene. The audio engine can be used to add custom nodes to the audio graph. API-Since: 9.0
-
audioEnvironmentNode
@NotNull @NotNull AVAudioEnvironmentNode audioEnvironmentNode()
[@property] audioEnvironmentNode Contains the instance of audio environment node used by the scene to spacialize sounds. API-Since: 9.0
-
audioListener
@Nullable @Nullable SCNNode audioListener()
[@property] audioListener 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. API-Since: 9.0
-
autoenablesDefaultLighting
boolean autoenablesDefaultLighting()
[@property] autoenablesDefaultLighting 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.
-
colorPixelFormat
long colorPixelFormat()
[@property] colorPixelFormat The pixel format of the color attachment 0 of the renderer. This property is only valid on a renderer created with a Metal device. API-Since: 9.0
-
commandQueue
@Nullable @Nullable MTLCommandQueue commandQueue()
[@property] commandQueue 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. API-Since: 9.0
-
context
@Nullable @Nullable org.moe.natj.general.ptr.VoidPtr context()
[@property] context A Core OpenGL render context that is used as the render target (a CGLContextObj on macOS, an EAGLContext on iOS).
-
currentRenderCommandEncoder
@Nullable @Nullable MTLRenderCommandEncoder currentRenderCommandEncoder()
[@property] currentRenderCommandEncoder 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. API-Since: 9.0
-
debugOptions
long debugOptions()
[@property] debugOptions Specifies the debug options of the receiver. Defaults to SCNDebugOptionNone. API-Since: 9.0
-
delegate
@Nullable @Nullable java.lang.Object delegate()
[@property] delegate Specifies the renderer delegate.
-
depthPixelFormat
long depthPixelFormat()
[@property] depthPixelFormat The pixel format of the depth attachment of the renderer. This property is only valid on a renderer created with a Metal device. API-Since: 9.0
-
device
@Nullable @Nullable MTLDevice device()
[@property] device 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. API-Since: 9.0
-
hitTestOptions
@NotNull @NotNull NSArray<? extends SCNHitTestResult> hitTestOptions(CGPoint point, @Nullable @Nullable NSDictionary<java.lang.String,?> options)
hitTest:options: Returns an array of SCNHitTestResult for each node that contains a specified point.- Parameters:
point- A point in the coordinate system of the receiver.options- Optional parameters (see the "Hit test options" group for the available options).
-
isJitteringEnabled
boolean isJitteringEnabled()
[@property] jitteringEnabled 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.
-
setJitteringEnabled
void setJitteringEnabled(boolean value)
[@property] jitteringEnabled 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.
-
isNodeInsideFrustumWithPointOfView
boolean isNodeInsideFrustumWithPointOfView(@NotNull @NotNull SCNNode node, @NotNull @NotNull SCNNode pointOfView)isNodeInsideFrustum:withPointOfView: Test whether node is visible from the specified point of view. 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.- Parameters:
node- The node to test the visibility of.pointOfView- The point of view used to test the visibility.
-
isPlaying
boolean isPlaying()
[@property] playing Returns YES if the scene is playing, NO otherwise.
-
setPlaying
void setPlaying(boolean value)
[@property] playing Returns YES if the scene is playing, NO otherwise.
-
loops
boolean loops()
[@property] loops 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.
-
nodesInsideFrustumWithPointOfView
@NotNull @NotNull NSArray<? extends SCNNode> nodesInsideFrustumWithPointOfView(@NotNull @NotNull SCNNode pointOfView)
nodesInsideFrustumWithPointOfView: Returns an array containing the nodes visible from the specified point of view. 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. API-Since: 9.0- Parameters:
pointOfView- The point of view used to test the visibility.
-
overlaySKScene
@Nullable @Nullable SKScene overlaySKScene()
[@property] overlaySKScene Specifies the overlay of the receiver as a SpriteKit scene instance. Defaults to nil.
-
pointOfView
@Nullable @Nullable SCNNode pointOfView()
[@property] pointOfView Specifies the point of view used to render the scene. A point of view must have either a camera or a spot light attached.
-
prepareObjectShouldAbortBlock
boolean prepareObjectShouldAbortBlock(@NotNull @NotNull java.lang.Object object, @Nullable @Nullable SCNSceneRenderer.Block_prepareObjectShouldAbortBlock block)prepareObject:shouldAbortBlock: Prepare the specified object for drawing. 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.- Parameters:
object- The object to prepare. It can be an instance of SCNScene, SCNNode, SCNGeometry, or SCNMaterialblock- This block will be called repeatedly while the object is prepared. Return YES if you want the operation to abort.
-
prepareObjectsWithCompletionHandler
void prepareObjectsWithCompletionHandler(@NotNull @NotNull NSArray<?> objects, @Nullable @Nullable SCNSceneRenderer.Block_prepareObjectsWithCompletionHandler completionHandler)prepareObjects:withCompletionHandler: Prepare the specified objects for drawing on the background. This method is observable using NSProgress.- Parameters:
objects- The objects to prepare. It can be one or more instances of SCNScene, SCNNode, SCNGeometry, or SCNMaterialcompletionHandler- This block will be called when all objects has been prepared, or on failure.
-
presentSceneWithTransitionIncomingPointOfViewCompletionHandler
void presentSceneWithTransitionIncomingPointOfViewCompletionHandler(@NotNull @NotNull SCNScene scene, @NotNull @NotNull SKTransition transition, @Nullable @Nullable SCNNode pointOfView, @Nullable @Nullable SCNSceneRenderer.Block_presentSceneWithTransitionIncomingPointOfViewCompletionHandler completionHandler)presentScene:withTransition:incomingPointOfView: Present a SCNScene in the receiver, replacing the current scene.- Parameters:
scene- The new scene to present.transition- the transition to use when presenting the scene.pointOfView- the point of view to use to render the new scene.completionHandler- the block invoked on completion. API-Since: 9.0
-
projectPoint
SCNVector3 projectPoint(SCNVector3 point)
projectPoint Projects a point in the world coordinate system using the receiver's current point of view and viewport. 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'.- Parameters:
point- The world position to be projected.
-
renderingAPI
long renderingAPI()
[@property] renderingAPI 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. API-Since: 9.0
-
scene
@Nullable @Nullable SCNScene scene()
[@property] scene Specifies the scene of the receiver.
-
sceneTime
double sceneTime()
[@property] sceneTime 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.
-
setAudioListener
void setAudioListener(@Nullable @Nullable SCNNode value)[@property] audioListener 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. API-Since: 9.0
-
setAutoenablesDefaultLighting
void setAutoenablesDefaultLighting(boolean value)
[@property] autoenablesDefaultLighting 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.
-
setDebugOptions
void setDebugOptions(long value)
[@property] debugOptions Specifies the debug options of the receiver. Defaults to SCNDebugOptionNone. API-Since: 9.0
-
setDelegate_unsafe
void setDelegate_unsafe(@Nullable @Nullable java.lang.Object value)[@property] delegate Specifies the renderer delegate.
-
setLoops
void setLoops(boolean value)
[@property] loops 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.
-
setOverlaySKScene
void setOverlaySKScene(@Nullable @Nullable SKScene value)[@property] overlaySKScene Specifies the overlay of the receiver as a SpriteKit scene instance. Defaults to nil.
-
setPointOfView
void setPointOfView(@Nullable @Nullable SCNNode value)[@property] pointOfView Specifies the point of view used to render the scene. A point of view must have either a camera or a spot light attached.
-
setScene
void setScene(@Nullable @Nullable SCNScene value)[@property] scene Specifies the scene of the receiver.
-
setSceneTime
void setSceneTime(double value)
[@property] sceneTime 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.
-
setShowsStatistics
void setShowsStatistics(boolean value)
[@property] showsStatistics 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.
-
showsStatistics
boolean showsStatistics()
[@property] showsStatistics 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.
-
stencilPixelFormat
long stencilPixelFormat()
[@property] stencilPixelFormat The pixel format of the stencil attachment of the renderer. This property is only valid on a renderer created with a Metal device. API-Since: 9.0
-
unprojectPoint
SCNVector3 unprojectPoint(SCNVector3 point)
unprojectPoint Unprojects a screenspace 2D point with depth info using the receiver's current point of view and viewport. 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'.- Parameters:
point- The screenspace position to be unprojected.
-
currentViewport
CGRect currentViewport()
[@property] currentViewport Returns the current viewport for this renderer, can be used to get the actual viewport from within the delegate callback during a live resize. API-Since: 13.0
-
isTemporalAntialiasingEnabled
boolean isTemporalAntialiasingEnabled()
[@property] temporalAntialiasingEnabled Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency. Defaults to NO. API-Since: 13.0
-
setTemporalAntialiasingEnabled
void setTemporalAntialiasingEnabled(boolean value)
[@property] temporalAntialiasingEnabled Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency. Defaults to NO. API-Since: 13.0
-
setUsesReverseZ
void setUsesReverseZ(boolean value)
[@property] usesReverseZ 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. API-Since: 13.0
-
usesReverseZ
boolean usesReverseZ()
[@property] usesReverseZ 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. API-Since: 13.0
-
currentRenderPassDescriptor
@NotNull @NotNull MTLRenderPassDescriptor currentRenderPassDescriptor()
[@property] currentRenderPassDescriptor 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. API-Since: 9.0
-
workingColorSpace
@NotNull @NotNull CGColorSpaceRef workingColorSpace()
[@property] workingColorSpace Specifies the color space used by the receiver for shading. SceneKit will automatically color match image and color objects (UIImage, UIColor, CGImageRef, CGColorRef, etc.). When you directly provide color components to shaders, use this property to color match them to the working color space. API-Since: 17.0
-
-