APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.badlogic.gdx.graphics.g3d.decals

public Class SimpleOrthoGroupStrategy

extends Object
implements GroupStrategy
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.graphics.g3d.decals.GroupStrategy
Imports
com.badlogic.gdx.Gdx, com.badlogic.gdx.graphics.GL20, com.badlogic.gdx.graphics.glutils.ShaderProgram, com.badlogic.gdx.utils.Array, .Sort

Minimalistic grouping strategy useful for orthogonal scenes where the camera faces the negative z axis. Handles enabling and disabling of blending and uses world-z only front to back sorting for transparent decals.

States (* = any, EV = entry value - same as value before flush):

expects exits on
glDepthMask true EV | true
GL_DEPTH_TEST enabled EV
glDepthFunc GL_LESS | GL_LEQUAL EV
GL_BLEND disabled EV | disabled
glBlendFunc * *
GL_TEXTURE_2D * disabled

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private SimpleOrthoGroupStrategy.Comparator
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterGroup(int group)

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.afterGroup.

Invoked directly after rendering of a group has completed

public void
afterGroups()

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.afterGroups.

Invoked after having rendered all groups

public void
beforeGroup(int group, Array<Decal> contents)

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.beforeGroup.

Invoked directly before rendering the contents of a group

public void
beforeGroups()

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.beforeGroups.

Invoked before rendering any group

public int
public ShaderProgram
getGroupShader(int group)

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.getGroupShader.

Returns the shader to be used for the group.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

comparatorback to summary
private SimpleOrthoGroupStrategy.Comparator comparator
GROUP_BLENDback to summary
private static final int GROUP_BLEND
GROUP_OPAQUEback to summary
private static final int GROUP_OPAQUE

Constructor Detail

SimpleOrthoGroupStrategyback to summary
public SimpleOrthoGroupStrategy()

Method Detail

afterGroupback to summary
public void afterGroup(int group)

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.afterGroup.

Doc from com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.afterGroup.

Invoked directly after rendering of a group has completed

Annotations
@Override
afterGroupsback to summary
public void afterGroups()

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.afterGroups.

Doc from com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.afterGroups.

Invoked after having rendered all groups

Annotations
@Override
beforeGroupback to summary
public void beforeGroup(int group, Array<Decal> contents)

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.beforeGroup.

Doc from com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.beforeGroup.

Invoked directly before rendering the contents of a group

Annotations
@Override
beforeGroupsback to summary
public void beforeGroups()

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.beforeGroups.

Doc from com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.beforeGroups.

Invoked before rendering any group

Annotations
@Override
decideGroupback to summary
public int decideGroup(Decal decal)

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.decideGroup.

Doc from com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.decideGroup.

Assigns a group to a decal

Annotations
@Override
getGroupShaderback to summary
public ShaderProgram getGroupShader(int group)

Implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.getGroupShader.

Doc from com.badlogic.gdx.graphics.g3d.decals.GroupStrategy.getGroupShader.

Returns the shader to be used for the group. Can be null in which case the GroupStrategy doesn't support GLES 2.0

Annotations
@Override
com.badlogic.gdx.graphics.g3d.decals back to summary

pack-priv Class SimpleOrthoGroupStrategy.Comparator

extends Object
implements Comparator<Decal>
Class Inheritance
  • java.lang.Object
  • com.badlogic.gdx.graphics.g3d.decals.SimpleOrthoGroupStrategy.Comparator
All Implemented Interfaces
java.util.Comparator

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
compare(Decal a, Decal b)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Comparatorback to summary
pack-priv Comparator()

Method Detail

compareback to summary
public int compare(Decal a, Decal b)

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