Last active
August 29, 2015 14:27
-
-
Save xoppa/7c7c10ca52f65b00aa99 to your computer and use it in GitHub Desktop.
Pseudo code of a simple RenderableProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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