GCubeSDK
©2026 FenixFox®Studios

Layers

Class representing a layers object that assigns a 3D object to 1 or more of 32 layers. A layers object assigns an 3D object to 1 or more of 32 layers numbered 0 to 31. Internally the layers are stored as a bit mask, and by default all 3D objects are a member of layer 0. This can be used to control visibility - an object must share a layer with a camera to be visible when that camera's view is rendered.

Methods

Layers()

Constructor to create new layers instance

Layers& set(u32 layer)

Sets membership to the given layer, and remove membership all other layers

layer layer to set

Layers& enable(u32 layer)

Adds membership of the given layer

layer layer to enable

Layers& disable(u32 layer)

Removes membership of the given layer

layer layer to disable

Layers& toggle(u32 layer)

Toggles the membership of the given layer

layer layer to toggle

Layers& enableAll()

Adds membership to all layers

Layers& disableAll()

Removes the membership from all layers

bool isEnabled(u32 layer) const

Returns true if the given layer is enabled

layer layer to test

bool test(const Layers& layers) const

Returns true if this and the given layers object have at least one layer in common

layers layers to test

Layers clone() const

Returns a new layers object with copied values from this instance

Layers& copy(const Layers& layers)

Copies the values of the given layers object to this instance

layers layers object to copy from

bool equals(const Layers& layers) const

Returns true if this layers object is equal with the given one

layers layers object to compare with this one

bool operator==(const Layers& layers) const

Checks if this layers object equals another

layers layers object to compare with

bool operator!=(const Layers& layers) const

Checks if this layers object does not equal another

layers layers object to compare with

Properties

mask u32 bit mask storing which of the 32 layers this layers object is currently a member of
isLayers bool Read
name string Optional display name
id u32 Unique identifier
uuid string UUID string
enabled bool Active/inactive
version u32 Bumps on change