Saga
Saga Game Engine
Loading...
Searching...
No Matches
uniformGrid.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <unordered_map>
5#include <set>
6#include <glm/vec3.hpp>
7#include <optional>
8#include <vector>
10
11
12namespace Saga {
21 template <class T>
23 using GridCell = std::list<T>;
24 public:
33 void insert(int x, int y, int z, T item);
34
42 void remove(int x, int y, int z, T item);
43
53 std::optional<GridCell> getCell(int x, int y, int z);
54 private:
55 std::unordered_map<std::tuple<int,int,int>, GridCell> cellMap;
56 };
57}
58
59#include "uniformGrid.inl"
60
Models a uniform grid in 3D space, with the ability to insert and inspect certain cells in the grid....
Definition: uniformGrid.h:22
std::optional< GridCell > getCell(int x, int y, int z)
Get the grid cell at a certain coordinate.
Definition: uniformGrid.inl:23
void insert(int x, int y, int z, T item)
Insert an item into the grid.
Definition: uniformGrid.inl:7
void remove(int x, int y, int z, T item)
Remove an item from a grid cell.
Definition: uniformGrid.inl:12
Definition: app.cpp:8