载入中...
搜索中...
未找到
eve::spatial::QuadTree类 参考

Region quadtree for 2D AABB broad-phase / map culling. Items are stored in the smallest node that fully contains them; spanning items stay at the parent. Scripts use insert/remove/query* + getResult*. 更多...

#include <QuadTree.h>

Public 成员函数

 QuadTree (float minX, float minY, float maxX, float maxY, int maxDepth=8, int maxPerNode=8)
 
 ~QuadTree ()=default
 
 QuadTree (const QuadTree &)=delete
 
QuadTreeoperator= (const QuadTree &)=delete
 
void clear ()
 
bool insert (int id, float minX, float minY, float maxX, float maxY)
 
bool remove (int id)
 
bool update (int id, float minX, float minY, float maxX, float maxY)
 
bool contains (int id) const
 
int getCount () const
 
int queryPoint (float x, float y)
 
int queryRect (float minX, float minY, float maxX, float maxY)
 
int queryCircle (float cx, float cy, float radius)
 
int getResultCount () const
 
int getResultId (int index) const
 
float getMinX () const
 
float getMinY () const
 
float getMaxX () const
 
float getMaxY () const
 
int getMaxDepth () const
 
int getMaxPerNode () const
 

详细描述

Region quadtree for 2D AABB broad-phase / map culling. Items are stored in the smallest node that fully contains them; spanning items stay at the parent. Scripts use insert/remove/query* + getResult*.

在文件 QuadTree.h17 行定义.

构造及析构函数说明

◆ QuadTree() [1/2]

eve::spatial::QuadTree::QuadTree ( float  minX,
float  minY,
float  maxX,
float  maxY,
int  maxDepth = 8,
int  maxPerNode = 8 
)

◆ ~QuadTree()

eve::spatial::QuadTree::~QuadTree ( )
default

◆ QuadTree() [2/2]

eve::spatial::QuadTree::QuadTree ( const QuadTree )
delete

成员函数说明

◆ clear()

void eve::spatial::QuadTree::clear ( )

在文件 QuadTree.cpp26 行定义.

引用了 eve::spatial::QueryIds::clear().

◆ contains()

bool eve::spatial::QuadTree::contains ( int  id) const

在文件 QuadTree.cpp33 行定义.

被这些函数引用 insert(), remove() , 以及 update().

◆ getCount()

int eve::spatial::QuadTree::getCount ( ) const
inline

在文件 QuadTree.h31 行定义.

◆ getMaxDepth()

int eve::spatial::QuadTree::getMaxDepth ( ) const
inline

在文件 QuadTree.h44 行定义.

◆ getMaxPerNode()

int eve::spatial::QuadTree::getMaxPerNode ( ) const
inline

在文件 QuadTree.h45 行定义.

◆ getMaxX()

float eve::spatial::QuadTree::getMaxX ( ) const
inline

在文件 QuadTree.h42 行定义.

引用了 eve::spatial::AABB2::maxX.

◆ getMaxY()

float eve::spatial::QuadTree::getMaxY ( ) const
inline

在文件 QuadTree.h43 行定义.

引用了 eve::spatial::AABB2::maxY.

◆ getMinX()

float eve::spatial::QuadTree::getMinX ( ) const
inline

在文件 QuadTree.h40 行定义.

引用了 eve::spatial::AABB2::minX.

◆ getMinY()

float eve::spatial::QuadTree::getMinY ( ) const
inline

在文件 QuadTree.h41 行定义.

引用了 eve::spatial::AABB2::minY.

◆ getResultCount()

int eve::spatial::QuadTree::getResultCount ( ) const
inline

在文件 QuadTree.h37 行定义.

引用了 eve::spatial::QueryIds::getCount().

◆ getResultId()

int eve::spatial::QuadTree::getResultId ( int  index) const
inline

在文件 QuadTree.h38 行定义.

引用了 eve::spatial::QueryIds::getId().

◆ insert()

bool eve::spatial::QuadTree::insert ( int  id,
float  minX,
float  minY,
float  maxX,
float  maxY 
)

在文件 QuadTree.cpp35 行定义.

引用了 b, contains(), id, eve::spatial::makeAABB2() , 以及 remove().

被这些函数引用 update().

◆ operator=()

QuadTree & eve::spatial::QuadTree::operator= ( const QuadTree )
delete

◆ queryCircle()

int eve::spatial::QuadTree::queryCircle ( float  cx,
float  cy,
float  radius 
)

◆ queryPoint()

int eve::spatial::QuadTree::queryPoint ( float  x,
float  y 
)

◆ queryRect()

int eve::spatial::QuadTree::queryRect ( float  minX,
float  minY,
float  maxX,
float  maxY 
)

◆ remove()

bool eve::spatial::QuadTree::remove ( int  id)

在文件 QuadTree.cpp49 行定义.

引用了 contains().

被这些函数引用 insert().

◆ update()

bool eve::spatial::QuadTree::update ( int  id,
float  minX,
float  minY,
float  maxX,
float  maxY 
)

在文件 QuadTree.cpp56 行定义.

引用了 contains() , 以及 insert().


该类的文档由以下文件生成: