载入中...
搜索中...
未找到
Spatial.cpp
浏览该文件的文档.
21Octree *Spatial::newOctree(float minX, float minY, float minZ, float maxX, float maxY, float maxZ,
Binary space partition tree (kd-style AABB splits) for 2D culling. Alternating X/Y splits at node mid...
Definition BSPTree2D.h:18
bool update(int id, float minX, float minY, float maxX, float maxY)
Moves an existing item to a new AABB; false if unknown or out of bounds.
Definition BSPTree2D.cpp:54
int queryPoint(float x, float y)
Finds items overlapping a point; fills the result buffer.
Definition BSPTree2D.cpp:181
int getResultId(int index) const
Hit id at dense index from the last query*, or -1.
Definition BSPTree2D.h:52
int queryRect(float minX, float minY, float maxX, float maxY)
Finds items overlapping an AABB; fills the result buffer.
Definition BSPTree2D.cpp:187
int queryCircle(float cx, float cy, float radius)
Finds items overlapping a circle; fills the result buffer.
Definition BSPTree2D.cpp:194
bool insert(int id, float minX, float minY, float maxX, float maxY)
Inserts an item AABB; false if out of bounds or id already present.
Definition BSPTree2D.cpp:36
Binary space partition tree (kd-style AABB splits) for 3D culling. Alternating X/Y/Z splits at node m...
Definition BSPTree3D.h:18
int queryAABB(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Finds items overlapping an AABB; fills the result buffer.
Definition BSPTree3D.cpp:200
int querySphere(float cx, float cy, float cz, float radius)
Finds items overlapping a sphere; fills the result buffer.
Definition BSPTree3D.cpp:207
int queryPoint(float x, float y, float z)
Finds items overlapping a point; fills the result buffer.
Definition BSPTree3D.cpp:194
int getResultId(int index) const
Hit id at dense index from the last query*, or -1.
Definition BSPTree3D.h:52
bool update(int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Moves an existing item to a new AABB; false if unknown or out of bounds.
Definition BSPTree3D.cpp:57
bool insert(int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Inserts an item AABB; false if out of bounds or id already present.
Definition BSPTree3D.cpp:38
Region octree for 3D AABB broad-phase / scene culling. Same storage rules as QuadTree (smallest fully...
Definition Octree.h:18
bool insert(int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Inserts an item AABB; false if out of bounds or id already present.
Definition Octree.cpp:37
int queryPoint(float x, float y, float z)
Finds items overlapping a point; fills the result buffer.
Definition Octree.cpp:161
int queryAABB(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Finds items overlapping an AABB; fills the result buffer.
Definition Octree.cpp:167
bool update(int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Moves an existing item to a new AABB; false if unknown or out of bounds.
Definition Octree.cpp:56
int querySphere(float cx, float cy, float cz, float radius)
Finds items overlapping a sphere; fills the result buffer.
Definition Octree.cpp:174
int getResultId(int index) const
Hit id at dense index from the last query*, or -1.
Definition Octree.h:52
Region quadtree for 2D AABB broad-phase / map culling. Items are stored in the smallest node that ful...
Definition QuadTree.h:19
bool insert(int id, float minX, float minY, float maxX, float maxY)
Inserts an item AABB; false if out of bounds or id already present.
Definition QuadTree.cpp:35
bool update(int id, float minX, float minY, float maxX, float maxY)
Moves an existing item to a new AABB; false if unknown or out of bounds.
Definition QuadTree.cpp:56
int queryPoint(float x, float y)
Finds items overlapping a point; fills the result buffer.
Definition QuadTree.cpp:157
int getResultId(int index) const
Hit id at dense index from the last query*, or -1.
Definition QuadTree.h:53
int queryRect(float minX, float minY, float maxX, float maxY)
Finds items overlapping an AABB; fills the result buffer.
Definition QuadTree.cpp:163
int queryCircle(float cx, float cy, float radius)
Finds items overlapping a circle; fills the result buffer.
Definition QuadTree.cpp:170
Uniform-grid spatial hash for 2D AABB queries (map / particle / entity culling). Items are registered...
Definition SpatialHash2D.h:18
int getResultId(int index) const
Hit id at dense index from the last query*, or -1.
Definition SpatialHash2D.h:56
bool update(int id, float minX, float minY, float maxX, float maxY)
Moves an existing item to a new AABB; false if unknown or out of bounds.
Definition SpatialHash2D.cpp:86
void setCellSize(float cellSize)
Sets cell size and clears existing entries.
Definition SpatialHash2D.cpp:12
int queryPoint(float x, float y)
Finds items overlapping a point; fills the result buffer.
Definition SpatialHash2D.cpp:118
int queryRect(float minX, float minY, float maxX, float maxY)
Finds items overlapping an AABB; fills the result buffer.
Definition SpatialHash2D.cpp:125
int queryCircle(float cx, float cy, float radius)
Finds items overlapping a circle; fills the result buffer.
Definition SpatialHash2D.cpp:133
bool insert(int id, float minX, float minY, float maxX, float maxY)
Inserts an item AABB; false if out of bounds or id already present.
Definition SpatialHash2D.cpp:69
Uniform-grid spatial hash for 3D AABB / sphere queries.
Definition SpatialHash3D.h:15
bool insert(int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Inserts an item AABB; false if out of bounds or id already present.
Definition SpatialHash3D.cpp:75
int querySphere(float cx, float cy, float cz, float radius)
Finds items overlapping a sphere; fills the result buffer.
Definition SpatialHash3D.cpp:146
void setCellSize(float cellSize)
Sets cell size and clears existing entries.
Definition SpatialHash3D.cpp:12
bool update(int id, float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Moves an existing item to a new AABB; false if unknown or out of bounds.
Definition SpatialHash3D.cpp:93
int getResultId(int index) const
Hit id at dense index from the last query*, or -1.
Definition SpatialHash3D.h:53
int queryAABB(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Finds items overlapping an AABB; fills the result buffer.
Definition SpatialHash3D.cpp:137
int queryPoint(float x, float y, float z)
Finds items overlapping a point; fills the result buffer.
Definition SpatialHash3D.cpp:129
Spatial index module — broad-phase / map culling structures. Script: spatial <- eve....
Definition Spatial.h:21
BSPTree2D * newBSPTree2D(float minX, float minY, float maxX, float maxY, int maxDepth=12, int maxPerNode=8)
Creates a 2D BSP/kd tree over the given bounds. @ownership Caller deletes.
Definition Spatial.cpp:30
Octree * newOctree(float minX, float minY, float minZ, float maxX, float maxY, float maxZ, int maxDepth=8, int maxPerNode=8)
Creates an Octree over the given 3D bounds. @ownership Caller deletes.
Definition Spatial.cpp:21
SpatialHash3D * newSpatialHash3D(float cellSize=64.f)
Creates a 3D spatial hash with the given cell size. @ownership Caller deletes.
Definition Spatial.cpp:28
SpatialHash2D * newSpatialHash2D(float cellSize=64.f)
Creates a 2D spatial hash with the given cell size. @ownership Caller deletes.
Definition Spatial.cpp:26
QuadTree * newQuadTree(float minX, float minY, float maxX, float maxY, int maxDepth=8, int maxPerNode=8)
Creates a QuadTree over the given 2D bounds. @ownership Caller deletes.
Definition Spatial.cpp:16
BSPTree3D * newBSPTree3D(float minX, float minY, float minZ, float maxX, float maxY, float maxZ, int maxDepth=12, int maxPerNode=8)
Creates a 3D BSP/kd tree over the given bounds. @ownership Caller deletes.
Definition Spatial.cpp:35
Definition Scene.h:36