Skip to content

Use a better quadtree #11

@TheRealMorgenfrue

Description

@TheRealMorgenfrue

The quadtree currently used only allows insertion and "stack", i.e., approxmate all points in the tree w.r.t. the query point using the Barnes-Hut algorithm. The new quadtree should also support querying a single point for intersection with the points in the tree.

Currently, there is one use case that will benefit from the new quadtree:

  • In node dragging, when the user clicks on the screen, we need to know if the current cursor position is within the boundary of a node. Currently, this is implemented in O(n) time by iterating through all nodes and computing intersection between the cursor and the node. By using the new quadtree, it can be improved to O(lg n).

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceRelated to performance increase / regression

    Type

    No type

    Projects

    Status

    Future Work

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions