Wayverb
voxel_structs.h
1 #pragma once
2 
3 #include "core/cl/representation.h"
4 #include "core/cl/traits.h"
5 
6 namespace wayverb {
7 namespace core {
8 
9 struct alignas(1 << 4) aabb final {
10  cl_float3 c0;
11  cl_float3 c1;
12 };
13 
14 template <>
15 struct cl_representation<aabb> final {
16  static constexpr auto value = R"(
17 typedef struct {
18  float3 c0;
19  float3 c1;
20 } aabb;
21 )";
22 };
23 
24 constexpr auto to_tuple(const aabb& x) { return std::tie(x.c0, x.c1); }
25 
26 constexpr bool operator==(const aabb& a, const aabb& b) {
27  return to_tuple(a) == to_tuple(b);
28 }
29 
30 constexpr bool operator!=(const aabb& a, const aabb& b) { return !(a == b); }
31 
32 } // namespace core
33 } // namespace wayverb
Definition: representation.h:7
Definition: voxel_structs.h:9
Definition: traits.cpp:2
Definition: capsule_base.h:9