A mask that defines which categories the node belongs to.
SDKs
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Scene
Kit
Declaration
var categoryBitMask: Int { get set }
Discussion
You can assign each node in a scene to one or more categories, where each category corresponds to a bit in the bit mask. You define the mask values used in your app. When SceneKit renders a scene, it compares the each node’s category
property with the category bit masks of every other object that participates in the rendering process—lights, cameras, and techniques—using a bitwise AND operation. If the result is a nonzero value, SceneKit includes the node when rendering. The default category bit mask is 1
.
Use a node’s category bit mask together with:
An
SCNLight
object’scategory
property to exclude the node from that light’s illuminationBit Mask An
SCNCamera
object’scategory
property to make the node invisible to that cameraBit Mask The category bit masks in an
SCNTechnique
object’s definition dictionary to include or exclude the node from phases of a multipass rendering technique
Note
This property does not affect SceneKit’s physics simulation. To include or exclude a node from physics interactions, use the category
property of the node’s physics
and physics
objects.