Class SpatialQuadtree<T extends SpatialQuadtree.SpatialObject2D>

java.lang.Object
org.episteme.core.mathematics.structures.SpatialQuadtree<T>
Type Parameters:
T - The type of objects stored in the quadtree, must implement SpatialObject2D.

public class SpatialQuadtree<T extends SpatialQuadtree.SpatialObject2D> extends Object
Generic Spatial Quadtree structure for high-performance 2D spatial partitioning.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • SpatialQuadtree

      public SpatialQuadtree(Real centerX, Real centerY, Real size)
      Creates a new Spatial Quadtree with given bounds.
      Parameters:
      centerX - Center X coordinate
      centerY - Center Y coordinate
      size - Size of the square (edge length)
  • Method Details

    • insert

      public void insert(T object)
      Inserts an object into the quadtree.
      Parameters:
      object - The object to insert
    • computeCenterOfMass

      public void computeCenterOfMass()
      Recursively computes the center of mass for all nodes.
    • getRoot

      public SpatialQuadtree.Node<T> getRoot()
      Returns the root node of the quadtree.
      Returns:
      The root node