Euphoria
aabb.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 
5 #include "base/vec3.h"
6 
7 namespace eu
8 {
9  struct Random;
10 }
11 
12 namespace eu
13 {
14  struct Aabb
15  {
18 
19  Aabb(const vec3f& amin, const vec3f& amax);
20  [[nodiscard]] static Aabb create_empty();
21 
22  void extend(const vec3f& vec);
23  void extend(const Aabb& aabb);
24  void offset(const vec3f& vec);
25 
26  [[nodiscard]] vec3f wrap(const vec3f& vec) const;
27  [[nodiscard]] Aabb offset_copy(const vec3f& vec) const;
28 
29  [[nodiscard]] vec3f get_size() const;
30  [[nodiscard]] bool is_valid() const;
31  [[nodiscard]] vec3f get_offset() const;
32 
33 
34  [[nodiscard]] std::vector<vec3f> calc_all_corners() const;
35  };
36 
37  std::string to_string(const Aabb& a);
38  vec3f get_random_point(Random* rand, const Aabb&);
39 }
40 
ADD_DEFAULT_FORMATTER(eu::Aabb, std::string, eu::to_string)
Definition: assert.h:90
std::string to_string(const Aabb &a)
Definition: aabb.cc:110
vec3f get_random_point(Random *rand, const Aabb &a)
Definition: aabb.cc:116
Definition: aabb.h:15
Aabb(const vec3f &amin, const vec3f &amax)
Definition: aabb.cc:10
Aabb offset_copy(const vec3f &vec) const
Definition: aabb.cc:89
vec3f get_size() const
Definition: aabb.cc:56
std::vector< vec3f > calc_all_corners() const
Definition: aabb.cc:98
bool is_valid() const
Definition: aabb.cc:64
vec3f min
Definition: aabb.h:16
vec3f get_offset() const
Definition: aabb.cc:73
static Aabb create_empty()
Definition: aabb.cc:49
vec3f wrap(const vec3f &vec) const
Definition: aabb.cc:17
void extend(const vec3f &vec)
Definition: aabb.cc:31
void offset(const vec3f &vec)
Definition: aabb.cc:81
vec3f max
Definition: aabb.h:17
WEL512 Random Number Generator.
Definition: random.h:21
Definition: vec3.h:48