quadtree

hi community,
we have some performance problem with our software, and we want to increase it.
For it we want to use a quadtree for it (not an octree, it’s for after).
The problem is that it seems that the quadtree is already implemented in panda … is that true ???
and if not, is evryone even implemented it ?

thx

You may use my EggOctree code to split up your egg geometry :
https://discourse.panda3d.org/viewtopic.php?t=2502

It allows you to define the subdivision level (actually, the maximum cell size) you want for each axis. In your case, you may choose to divide to cells with a very high Z maximum, eg 10000. Then, your geometry won’t be divided along the Z axis, and you’ll have a quadtree.


Edit : if you look at the post, you’ll find an example of how to use the code. Depending on your coordinate system, you may use Z or Y as the vertical axis :

self.octree.build(sourceNode, ed, Vec3D(3, 100, 3))

I use combo of octree and just hashing and putting objects into overlapping grids works well.