14 lines
308 B
Java

package engine.object;
import java.util.Comparator;
public class SortZ implements Comparator<ObjectGl>
{
public int compare(ObjectGl a, ObjectGl b)
{
float diff = a.getZPos() - b.getZPos();
if (diff < 0) return -1;
else if (diff > 0) return 1;
else return 0;
}
}