com.triangularpixels.rebirth.geometry2d
Class Atlas<T>
java.lang.Object
com.triangularpixels.rebirth.geometry2d.Atlas<T>
- Type Parameters:
T - the data type to associate with each packed rectangle
public class Atlas<T>
- extends Object
An atlas packs multiple axis-aligned rectangles into a single larger rectangle with integer precision.
The space is divided using a BSP tree to try and waste as little space as possible.
For best results insert the largest rectangles (by area) first.
- Author:
- John Campbell
|
Constructor Summary |
Atlas(int width,
int height)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Atlas
public Atlas(int width,
int height)
getWidth
public int getWidth()
getHeight
public int getHeight()
insert
public IntRectangle insert(int insertW,
int insertH,
T t)
remove
public boolean remove(T t)
getAll
public ArrayList<Atlas.Entry<T>> getAll()
calcEfficiency
public float calcEfficiency()
Copyright © 2009 TriangularPixels.com. All Rights Reserved.