Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
anchor_mask.hpp
Go to the documentation of this file.
1
7
8
#pragma once
9
10
#include <cstdint>
11
12
namespace
physics {
13
14
enum class
AnchorFace : uint8_t {
15
neg_x = 0b000001,
16
pos_x = 0b000010,
17
neg_y = 0b000100,
18
pos_y = 0b001000,
19
neg_z = 0b010000,
20
pos_z = 0b100000,
21
};
22
23
using
AnchorMask = uint8_t;
24
inline
constexpr
AnchorMask k_anchor_null = 0;
25
inline
constexpr
AnchorMask k_anchor_bottom =
static_cast<
AnchorMask
>
(AnchorFace::neg_z);
26
27
constexpr
auto
anchorFaceBit(AnchorFace face) -> AnchorMask {
28
return
static_cast<
AnchorMask
>
(face);
29
}
30
31
constexpr
auto
hasAnchorFace(AnchorMask mask, AnchorFace face) ->
bool
{
32
return
(mask & anchorFaceBit(face)) != 0;
33
}
34
35
}
engine
src
toast
physics
anchor_mask.hpp
Generated by
1.17.0