Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
gridaabb.h
1 #pragma once
2 
3 #include <glm/glm.hpp>
4 
5 #include "axis.h"
6 
7 
8 /*
9  An AABB inside a grid, which means that an AABB from 0,0,0 to 0,0,0
10  covers exactly one cell
11 */
12 class GridAABB {
13 public:
14  GridAABB();
15  GridAABB(const glm::ivec3 &llf, const glm::ivec3 &urb);
16 
17  const glm::ivec3 &llf() const;
18  void setLLF(const glm::ivec3& llf);
19 
20  const glm::ivec3 &urb() const;
21  void setURB(const glm::ivec3& urb);
22 
23  bool contains(const glm::ivec3& cell) const;
24 
25  int extent(Axis axis) const;
26 
27  /*
28  Distance from LLF to URB
29  */
30  float diameter() const;
31 
32  bool operator==(const GridAABB& other) const;
33 
34 
35 protected:
36  glm::ivec3 m_llf;
37  glm::ivec3 m_urb;
38 };
39 
Definition: gridaabb.h:12