SCNNodeRendererDelegate

Trait SCNNodeRendererDelegate 

Source
pub unsafe trait SCNNodeRendererDelegate: NSObjectProtocol {
    // Provided method
    unsafe fn renderNode_renderer_arguments(
        &self,
        node: &SCNNode,
        renderer: &SCNRenderer,
        arguments: &NSDictionary<NSString, AnyObject>,
    )
       where Self: Sized + Message { ... }
}
Available on crate feature SCNNode only.
Expand description

The SCNNodeRendererDelegate protocol declares the methods that an instance of SCNNode invokes to let a delegate customize its rendering.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn renderNode_renderer_arguments( &self, node: &SCNNode, renderer: &SCNRenderer, arguments: &NSDictionary<NSString, AnyObject>, )
where Self: Sized + Message,

Available on crate feature SCNRenderer only.

Invoked when a node is rendered.

The preferred way to customize the rendering is to tweak the material properties of the different materials of the node’s geometry. SCNMaterial conforms to the SCNShadable protocol and allows for more advanced rendering using GLSL. You would typically use a renderer delegate with a node that has no geometry and only serves as a location in space. An example would be attaching a particle system to that node and render it with custom OpenGL code. Only drawing calls and the means to achieve them are supposed to be performed during the renderer delegate callback, any changes in the model (nodes, geometry…) would involve unexpected results.

Parameter node: The node to render.

Parameter renderer: The scene renderer to render into.

Parameter arguments: A dictionary whose values are SCNMatrix4 matrices wrapped in NSValue objects.

Trait Implementations§

Source§

impl ProtocolType for dyn SCNNodeRendererDelegate

Source§

const NAME: &'static str = "SCNNodeRendererDelegate"

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 SCNNodeRendererDelegate

Implementations on Foreign Types§

Source§

impl<T> SCNNodeRendererDelegate for ProtocolObject<T>

Implementors§