APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.graphics.g3d.utils

public Class DefaultRenderableSorter

extends Object
implements RenderableSorter, Comparator<Renderable>
Class Inheritance
All Implemented Interfaces
java.util.Comparator, com.badlogic.gdx.graphics.g3d.utils.RenderableSorter
Imports
java.util.Comparator, com.badlogic.gdx.graphics.Camera, com.badlogic.gdx.graphics.g3d.Renderable, com.badlogic.gdx.graphics.g3d.attributes.BlendingAttribute, com.badlogic.gdx.math.Matrix4, .Vector3, com.badlogic.gdx.utils.Array

Field Summary

Modifier and TypeField and Description
private Camera
private final Vector3
private final Vector3

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
compare(final Renderable o1, final Renderable o2)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

private Vector3
getTranslation(Matrix4 worldTransform, Vector3 center, Vector3 output)

public void
sort(final Camera camera, final Array<Renderable> renderables)

Implements com.badlogic.gdx.graphics.g3d.utils.RenderableSorter.sort.

Sorts the array of Renderable instances based on some criteria, e.g. material, distance to camera etc.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cameraback to summary
private Camera camera
tmpV1back to summary
private final Vector3 tmpV1
tmpV2back to summary
private final Vector3 tmpV2

Constructor Detail

DefaultRenderableSorterback to summary
public DefaultRenderableSorter()

Method Detail

compareback to summary
public int compare(final Renderable o1, final Renderable o2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Annotations
@Override
getTranslationback to summary
private Vector3 getTranslation(Matrix4 worldTransform, Vector3 center, Vector3 output)
sortback to summary
public void sort(final Camera camera, final Array<Renderable> renderables)

Implements com.badlogic.gdx.graphics.g3d.utils.RenderableSorter.sort.

Doc from com.badlogic.gdx.graphics.g3d.utils.RenderableSorter.sort.

Sorts the array of Renderable instances based on some criteria, e.g. material, distance to camera etc.

Annotations
@Override