de.rico.engine.geometry.comparator
Class DistanceToCameraComparator

java.lang.Object
  extended by de.rico.engine.geometry.comparator.DistanceToCameraComparator
All Implemented Interfaces:
java.util.Comparator<AbstractMesh>

public class DistanceToCameraComparator
extends java.lang.Object
implements java.util.Comparator<AbstractMesh>

This is a comparator class that can be used to compare the distances to the camera of the meshes. Because this comparater uses the only the center points of the meshes and not their expansion into the world to perform the sorting, the result are not garanteed to be correct in any case. This is just some kind of rough sorting.

Author:
Frank Bruns

Constructor Summary
DistanceToCameraComparator()
           
 
Method Summary
 int compare(AbstractMesh mesh1, AbstractMesh mesh2)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DistanceToCameraComparator

public DistanceToCameraComparator()
Method Detail

compare

public int compare(AbstractMesh mesh1,
                   AbstractMesh mesh2)
Specified by:
compare in interface java.util.Comparator<AbstractMesh>