Toast Engine
Loading...
Searching...
No Matches
layers.hpp File Reference

Collision layers. More...

#include <cstdint>
#include <string>
#include <string_view>
#include <toast/export.hpp>
#include <vector>
Include dependency graph for layers.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  physics::LayerFilter

Enumerations

enum  BuiltinLayer : uint8_t {
  default_layer = 0 , trigger_layer , characters_layer , player_layer ,
  small_debris_layer , large_debris_layer , projectiles_layer
}

Functions

constexpr auto physics::layerBit (int layer) -> uint32_t
constexpr void physics::includeLayer (LayerFilter &filter, int layer, bool value)
constexpr void physics::excludeLayer (LayerFilter &filter, int layer, bool value)
constexpr auto physics::layersCollide (LayerFilter a, LayerFilter b) -> bool
auto physics::layerMask (const std::vector< int > &layers) -> uint32_t
 Mask of the given layer indices.
auto physics::getLayer (std::string_view name) -> int
 Index of the layer named name.
auto physics::layerName (int layer) -> std::string
auto physics::layerAbbreviation (int layer) -> std::string
void physics::registerLayerSettings ()

Variables

constexpr int physics::k_layer_count = 32
constexpr uint32_t physics::k_all_layers = 0xFFFF'FFFFu
constexpr size_t physics::k_layer_abbreviation_length = 3

Detailed Description

Collision layers.

Author
Xein
Date
12 Oct 2026

Function Documentation

◆ includeLayer()

void physics::includeLayer ( LayerFilter & filter,
int layer,
bool value )
constexpr

Puts layer in or out of the included mask