Files
EVEngine/src/modules/spatial/Spatial.h
T
西风逍遥游 4377e062dd feat: zeroerr parameter validation + Doxygen API documentation
Squashed onto current main. Adds src/engine/common/Assert.h (EV_PARAM_CHECK / EV_ASSERT backed by zeroerr), an EVENGINE_ENABLE_ASSERTS option (non-Debug builds strip ZEROERR_NO_ASSERT unless enabled), parameter checks at key entry points, Doxygen comments across headers, Doxyfile + make docs / CMake docs targets, and Windows setup + code conventions in AGENTS.md.
2026-08-19 09:01:12 +08:00

42 lines
1.3 KiB
C++

#pragma once
#include "common/Module.h"
namespace eve::spatial {
class QuadTree;
class Octree;
class SpatialHash2D;
class SpatialHash3D;
class BSPTree2D;
class BSPTree3D;
/**
* @brief Spatial index module — broad-phase / map culling structures.
* Script: `spatial <- eve.Spatial();`
*
* Provides 2D/3D QuadTree, Octree, SpatialHash, and BSP (kd-style) factories.
* No overloads: use distinct *2D / *3D type names.
*/
class Spatial : public Module {
public:
Module_REG(Spatial);
Spatial() = default;
~Spatial() override = default;
QuadTree *newQuadTree(float minX, float minY, float maxX, float maxY, int maxDepth = 8,
int maxPerNode = 8);
Octree *newOctree(float minX, float minY, float minZ, float maxX, float maxY, float maxZ,
int maxDepth = 8, int maxPerNode = 8);
SpatialHash2D *newSpatialHash2D(float cellSize = 64.f);
SpatialHash3D *newSpatialHash3D(float cellSize = 64.f);
BSPTree2D *newBSPTree2D(float minX, float minY, float maxX, float maxY, int maxDepth = 12,
int maxPerNode = 8);
BSPTree3D *newBSPTree3D(float minX, float minY, float minZ, float maxX, float maxY, float maxZ,
int maxDepth = 12, int maxPerNode = 8);
};
} // namespace eve::spatial