Class TransparencySortController
- java.lang.Object
-
- com.sun.j3d.utils.scenegraph.transparency.TransparencySortController
-
public class TransparencySortController extends java.lang.Object
This class controls the Transparency Sorting scheme used by Java 3D when rendering transparent objects. By default (and in all previous versions of Java 3D) objects are sorted depending on the distance from the viewer of the centroid of their bounds. By supplying a different Comparator for a view using the static setComparator method the user can provide their own sorting scheme. The Comparator provided will be called with 2 objects of class TransparencySortGeom.- Since:
- Java 3D 1.4
-
-
Constructor Summary
Constructors Constructor Description TransparencySortController()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Comparator
getComparator(View view)
Returns the comparator for the specified viewstatic void
setComparator(View view, java.util.Comparator comparator)
Set the comparator for the specified view.
-
-
-
Method Detail
-
setComparator
public static void setComparator(View view, java.util.Comparator comparator)
Set the comparator for the specified view. The comparators compare method will be called with 2 objects of type TransparencySortGeom and it's result should indicate which object is closer to the viewer. Object1 < Object2 if it is to be considered closer and rendered after.- Parameters:
view
- the view to which the comparator appliescomparator
- the comparator to call
-
getComparator
public static java.util.Comparator getComparator(View view)
Returns the comparator for the specified view- Returns:
- the comparator for the specified view, or null if there is no comparator for the view or the view is unknown.
-
-