Contents

nodesInsideFrustum(of:)

Returns all nodes that might be visible from a specified point of view.

Declaration

func nodesInsideFrustum(of pointOfView: SCNNode) -> [SCNNode]

Parameters

  • pointOfView:

    A node defining a point of view, as used by the Pointofview property.

Return Value

An array of nodes whose bounding boxes intersect the view frustum defined by the pointOfView node. If the array is empty, no nodes lie within the specified frustum.

Discussion

Any node containing a camera or spotlight may serve as a point of view (see the pointOfView property for details). Such a node defines a viewing frustum—a portion of the scene’s coordinate space, shaped like a truncated pyramid, that encloses all points visible from that point of view.

Use this method find all nodes whose content lies within the viewing frustum defined by another node (which may or may not be the scene renderer’s current pointOfView node).

Note that this method does not perform occlusion testing. That is, the returned array includes any node that lies within the specified viewing frustum regardless of whether that node’s contents are obscured by other geometry.

See Also

Working With Projected Scene Contents