Flocc
    Preparing search index...

    Class KDTree

    0.3.5

    Index

    Constructors

    • Parameters

      • agents: Agent[]
      • dimension: number = 2
      • depth: number = 0
      • Optionalbbox: BBox

      Returns KDTree

    Properties

    agents: Agent[] = null
    bbox: BBox
    depth: number = 0
    dimension: number = 2
    left: KDTree = null
    median: number = null
    needsUpdating: boolean = false
    parent: KDTree = null
    right: KDTree = null

    Methods

    • Return all the Agents in this KDTree that are within d distance of the given Point or Agent pt.

      Parameters

      • pt: Agent | Point
      • d: number

      Returns Agent[]

      0.3.5

    • Parameters

      • pt: Agent | Point
      • d: number
      • coord: "x" | "y" | "z"

      Returns boolean

    • Returns the Agent in this KDTree that is closest spatially to the given Point or Agent pt.

      Parameters

      Returns Agent

      0.3.5

    • Rebalance the KDTree (if it has been marked as needing updating). Optionally pass the agents that belong to this tree (relevant for trees of higher depth than the top level).

      Parameters

      Returns void

      0.3.5