30 this,
this,
this,
this,
31 this,
this,
this,
this,
94 bool insert(
const AABox& area,
T value) {}
117 info(
"resolution = {}", resolution);
126 aabb.minimum = aabb.getCenter() + aabb.getHalfSize() *
octantDelta(
octant) / 2.0;
127 aabb.maximum = aabb.getCenter() - aabb.getHalfSize() *
octantDelta(
octant) / 2.0;
128 return insert(
node->children[
octant].get(), position, std::forward<T>(value), aabb, resolution / 2.0);
144 const Vector3 center = aabb.getCenter();
200 if(depth == maxDepth) {
215 const Vector3 center = aabb.getCenter();
216 return (position.x > center.x ? 0 : (1 << 0)) +
217 (position.y > center.y ? 0 : (1 << 1)) +
218 (position.z > center.z ? 0 : (1 << 2));
226 (
octant & (1 << 0)) ? -1.0 : 1.0,
227 (
octant & (1 << 1)) ? -1.0 : 1.0,
228 (
octant & (1 << 2)) ? -1.0 : 1.0);
#define CE_ASSERT(...)
Definition Macros.hpp:323
Path to file or directory.
Definition FilePath.hpp:37
Definition TerrainStorage.hpp:24
SharedMemory mSharedMemory
Definition TerrainStorage.hpp:53
bool insert(const AABox &area, T value)
Definition TerrainStorage.hpp:94
void reserve(size_t newCapacity)
Definition TerrainStorage.hpp:70
void insert(Node *node, Vector3 position, T &&value, AABox aabb, double resolution)
Definition TerrainStorage.hpp:116
~MemoryMappedTerrainOctree()
Definition TerrainStorage.hpp:67
Header * mHeader
Definition TerrainStorage.hpp:54
bool shouldCollapse(Node *const node, const T &firstValue)
Definition TerrainStorage.hpp:183
MemoryMappedTerrainOctree(const FilePath &path)
Definition TerrainStorage.hpp:57
bool insert(const Sphere &sphere, T value)
Definition TerrainStorage.hpp:96
void subdivide(Node *node)
Definition TerrainStorage.hpp:163
void subdivide(Node *node, size_t octant)
Definition TerrainStorage.hpp:174
void * nodeAt(size_t index)
Definition TerrainStorage.hpp:205
Node * allocateNode()
Definition TerrainStorage.hpp:101
Node * findOrCreateNode(Node *node, Vector2 position, T value, const UInt64 depth, const UInt64 maxDepth)
Definition TerrainStorage.hpp:199
static size_t getOctantFor(const Vector3 &position, const AABox &aabb)
Computes the octant of a position vector within the given aabb.
Definition TerrainStorage.hpp:214
static Vector3 octantDelta(const size_t octant)
Computes the delta position for a given octant.
Definition TerrainStorage.hpp:224
bool insert(Vector3 position, T value)
Definition TerrainStorage.hpp:89
void insert(Node *node, const Primitive &primitive, const T &value, const AABox &aabb, double resolution)
Definition TerrainStorage.hpp:131
A special pointer that stores the pointer as an offset of the pointee to the OffsetPtr instance itsel...
Definition OffsetPtr.hpp:65
Definition SharedMemory.hpp:17
void resize(SizeType newSize)
Resizes the array to fit at least newSize elements.
void sync()
Synchronizes any dirty data not synchronized with the file.
bool empty() const noexcept
Definition Application.hpp:19
std::uint64_t UInt64
Definition DataTypes.hpp:26
auto range()
Returns an iterator that increases it's value from 0 to end by 1 for each step.
Definition Iterator.hpp:350
@ Write
Requests writing support from the protocool.
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition TerrainStorage.hpp:35
Ptr< FreeNode > next
Definition TerrainStorage.hpp:36
FreeNode(const Ptr< FreeNode > &next)
Definition TerrainStorage.hpp:37
Definition TerrainStorage.hpp:27
Ptr< Node > children[8]
Definition TerrainStorage.hpp:29
T value
Definition TerrainStorage.hpp:28