Toast Engine
Loading...
Searching...
No Matches
collision.hpp
Go to the documentation of this file.
1
7
8#pragma once
9
10#include "body.hpp"
11#include "shape.hpp"
12
13#include <compare>
14#include <utility>
15
16namespace physics {
17
19 BodyID body;
20 ShapeID shape;
21 auto operator<=>(const BodyShapeKey&) const = default;
22};
23
27 auto operator<=>(const BroadPhasePair&) const = default;
28};
29
30[[nodiscard]]
31inline auto canonicalPair(BodyShapeKey first, BodyShapeKey second) -> BroadPhasePair {
32 if (second < first) {
33 std::swap(first, second);
34 }
35 return {.a = first, .b = second};
36}
37
38inline constexpr uint8_t k_primitive_manifold_normal_index = 0xFFu;
39
40}
Body identifiers, creation data, and copied runtime state.
Shape identifiers, geometry, and runtime records.
Definition body.hpp:20
Definition collision.hpp:18
Definition collision.hpp:24
Definition shape.hpp:29