Interface SCNSceneRenderer

  • All Known Implementing Classes:
    ARSCNView, SCNRenderer, SCNView

    public interface SCNSceneRenderer
    [@protocol] SCNSceneRenderer Protocol adopted by the various renderers (SCNView, SCNLayer, SCNRenderer)
    • Method Detail

      • audioEngine

        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.
      • audioEnvironmentNode

        AVAudioEnvironmentNode audioEnvironmentNode()
        [@property] audioEnvironmentNode Contains the instance of audio environment node used by the scene to spacialize sounds.
      • audioListener

        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.
      • 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.
      • commandQueue

        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.
      • context

        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

        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.
      • debugOptions

        long debugOptions()
        [@property] debugOptions Specifies the debug options of the receiver. Defaults to SCNDebugOptionNone.
      • delegate

        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.
      • device

        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.
      • hitTestOptions

        NSArray<? extends SCNHitTestResult> hitTestOptions​(CGPoint point,
                                                           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​(SCNNode node,
                                                   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

        NSArray<? extends SCNNode> nodesInsideFrustumWithPointOfView​(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.
        Parameters:
        pointOfView - The point of view used to test the visibility.
      • overlaySKScene

        SKScene overlaySKScene()
        [@property] overlaySKScene Specifies the overlay of the receiver as a SpriteKit scene instance. Defaults to nil.
      • pointOfView

        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​(java.lang.Object object,
                                              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 SCNMaterial
        block - This block will be called repeatedly while the object is prepared. Return YES if you want the operation to abort.
      • prepareObjectsWithCompletionHandler

        void prepareObjectsWithCompletionHandler​(NSArray<?> objects,
                                                 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 SCNMaterial
        completionHandler - This block will be called when all objects has been prepared, or on failure.
      • presentSceneWithTransitionIncomingPointOfViewCompletionHandler

        void presentSceneWithTransitionIncomingPointOfViewCompletionHandler​(SCNScene scene,
                                                                            SKTransition transition,
                                                                            SCNNode pointOfView,
                                                                            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.
      • 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.
      • scene

        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​(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.
      • 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.
      • setDelegate

        void setDelegate​(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​(SKScene value)
        [@property] overlaySKScene Specifies the overlay of the receiver as a SpriteKit scene instance. Defaults to nil.
      • setPointOfView

        void setPointOfView​(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​(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.
      • 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.
      • isTemporalAntialiasingEnabled

        boolean isTemporalAntialiasingEnabled()
        [@property] temporalAntialiasingEnabled Specifies whether the receiver should reduce aliasing artifacts in real time based on temporal coherency. Defaults to NO.
      • 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.
      • 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.
      • 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.
      • currentRenderPassDescriptor

        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.