Namespace Engine::CollisionLayers¶
Namespace List > Engine > CollisionLayers
Namespace of collision layer helpers shared by ColliderComponent ,CollisionSystem , the editor Inspector and the Lua bindings.More...
Public Attributes¶
| Type | Name |
|---|---|
| std::uint32_t | kAllLayers = 0xFFFFFFFFuMask value matching every layer: the default for new colliders. |
| int | kDefaultLayer = 0Layer every new collider starts on (the Default preset). |
| int | kLayerCount = 32Number of usable layers (one bit each in a 32-bit mask). |
| std::array< std::string_view, 8 > | kLayerNames = /* multi line expression */Conventional names for the first layers, used by the Inspector and Layers.name() in Lua. Layers past these are named "Layer N". (these can be changed, or directly removed and provide the option to modify them. |
| int | kNamedLayerCount = static\_cast<int>(kLayerNames.size())Number of entries in kLayerNames . |
| std::uint32_t | kNoLayers = 0uMask value matching nothing: use it to make a collider inert. |
Public Functions¶
| Type | Name |
|---|---|
| std::uint32_t | Bit (int layer) The single-bit mask of one layer. |
| int | Index (std::string_view name) Resolves a layer from its name or its number. |
| std::string | Name (int layer) Display name of a layer: the preset name, or "Layer N" past them. |
Detailed Description¶
A collider belongs to one ColliderComponent::layer and carries a ColliderComponent::mask of the layers it is willing to touch. Two colliders only interact when both masks contain the other's layer, so either side can veto a pair ("this only collides with walls and pickups").
Layers are plain integers in [0, kLayerCount); nothing enforces the names below, they are a convention so the Inspector and Lua scripts can talk about layers without magic numbers.
Public Attributes Documentation¶
variable kAllLayers¶
Mask value matching every layer: the default for new colliders.
variable kDefaultLayer¶
Layer every new collider starts on (the Default preset).
variable kLayerCount¶
Number of usable layers (one bit each in a 32-bit mask).
variable kLayerNames¶
Conventional names for the first layers, used by the Inspector and Layers.name() in Lua. Layers past these are named "Layer N". (these can be changed, or directly removed and provide the option to modify them.
variable kNamedLayerCount¶
Number of entries in kLayerNames .
variable kNoLayers¶
Mask value matching nothing: use it to make a collider inert.
Public Functions Documentation¶
function Bit¶
The single-bit mask of one layer.
Returns:
0 for out-of-range layers, so callers never shift by >= 32.
function Index¶
Resolves a layer from its name or its number.
Returns:
The layer index, or -1 when name matches nothing.
function Name¶
Display name of a layer: the preset name, or "Layer N" past them.
The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Components/CollisionLayers.hpp