Class SVTQuadtree<T>

java.lang.Object
gaiasky.util.svt.SVTQuadtree<T>

public class SVTQuadtree<T> extends Object
  • Field Details Link icon

    • MAX_LEVEL Link icon

      public final int MAX_LEVEL
      See Also:
    • name Link icon

      public final String name
      Name of the tree.
    • tileSize Link icon

      public final int tileSize
      Size in pixels of each tile. Tiles are square, so width and height are equal. The tile size is a power of two, capping at 1024. One of 8, 16, 32, 64, 128, 256, 512 or 1024.
    • numTiles Link icon

      public int numTiles
      The total number of tiles in the tree.
    • depth Link icon

      public int depth
      Depth of the tree, e.g., the deepest level, in [0,n].
    • root Link icon

      public SVTQuadtreeNode<T>[] root
      Root node(s) of the tree.
    • levels Link icon

      public com.badlogic.gdx.utils.LongMap<SVTQuadtreeNode<T>>[] levels
      Each tile is identified by its level and its UV. Here we can access tiles directly.
    • aux Link icon

      public Object aux
      Auxiliary object to store additional data.
  • Constructor Details Link icon

    • SVTQuadtree Link icon

      public SVTQuadtree(String name, int tileSize, int rootPositions)
  • Method Details Link icon

    • insert Link icon

      public void insert(int level, int col, int row, T object)
    • getTile Link icon

      public SVTQuadtreeNode<T> getTile(int level, int col, int row)
      Gets a tile in the tree given its level, column and row.
      Parameters:
      level - The level.
      col - The column.
      row - The row.
      Returns:
      The tile with the given level, column and row, if it exists.
    • getTileFromUV Link icon

      public SVTQuadtreeNode<T> getTileFromUV(int level, double u, double v)
      Gets a tile given a level and texture coordinates in UV.
      Parameters:
      level - The level.
      u - The U texture coordinate in [0,1].
      v - The V texture coordinate in [0,1].
      Returns:
      The tile at the given level and UV.
    • getUTileCount Link icon

      public long getUTileCount(int level)
    • getVTileCount Link icon

      public long getVTileCount(int level)
    • getColRow Link icon

      public int[] getColRow(int level, double u, double v)
    • getUV Link icon

      public double[] getUV(int level, int col, int row)
    • contains Link icon

      public boolean contains(int level, int col, int row)
    • getKey Link icon

      public long getKey(int level, int col, int row)
    • getKey Link icon

      public long getKey(SVTQuadtreeNode<T> tile)
    • getResolution Link icon

      public int[] getResolution()
      Get the resolution of this SVT at the most-detailed level.
      Returns:
      The resolution at the most detailed level.