Package gaiasky.util.svt
Class SVTQuadtreeNode<T>
java.lang.Object
gaiasky.util.svt.SVTQuadtreeNode<T>
- All Implemented Interfaces:
Comparable<SVTQuadtreeNode>
A quadtree node that represents a single tile with a specific level of detail (LOD)
in the Sparse Virtual Texture (SVT).
Contains the level of detail (level
), the column within the level (col
), the
row within the level (row
) and the path to the actual texture file.
Each node is subdivided into four tiles like so:
0 1 .----.----. 0 | TL | TR | :----+----: 1 | BL | BR | '----'----'
Columns increase left-to-right, and rows increase top-to-bottom. Note that in UV coordinates, the V coordinate, corresponding to the rows, is inverted.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSVTQuadtreeNode
(SVTQuadtree<T> tree, SVTQuadtreeNode<T> parent, int level, int col, int row, T object) -
Method Summary
Modifier and TypeMethodDescriptionint
long
getKey()
Gets a unique 64-bit integer key for this tile, including the level, the column and the row.double[]
getUV()
Get the UV coordinates in [0,1] of the top left position of this tile.int
mipLevel()
Computes the OpenGL mip level for this tile.toString()
-
Field Details
-
tree
The tree this node belongs to. -
parent
The parent of this tile, if it is not at the root level. -
level
public final int level -
col
public final int col -
row
public final int row -
object
-
state
public int state -
accessed
public long accessed
-
-
Constructor Details
-
SVTQuadtreeNode
public SVTQuadtreeNode(SVTQuadtree<T> tree, SVTQuadtreeNode<T> parent, int level, int col, int row, T object)
-
-
Method Details
-
getUV
public double[] getUV()Get the UV coordinates in [0,1] of the top left position of this tile.- Returns:
- The UV coordinates of this tile.
-
mipLevel
public int mipLevel()Computes the OpenGL mip level for this tile.- Returns:
- The OpenGL mip level for this tile.
-
toString
-
toStringShort
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T>
-
getKey
public long getKey()Gets a unique 64-bit integer key for this tile, including the level, the column and the row.- Returns:
- The unique key.
-