Skip to content

Instantly share code, notes, and snippets.

@xoppa
Last active Aug 29, 2015
Embed
What would you like to do?
Pseudo code of a simple RenderableProvider
public class GameBoard implements RenderableProvider {
public static class BoardPiece extends Renderable {
public Matrix4 localTransform = new Matrix4();
}
public Array<BoardPiece> pieces = new Array<BoardPiece>();
public Matrix4 transform = new Matrix4();
@Override
public void getRenderables (Array<Renderable> renderables, Pool<Renderable> pool) {
for (BoardPiece piece : pieces) {
piece.worldTransform.set(transform).mul(piece.localTransform);
renderables.add(piece);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment