Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Added the view-matrix component in the SpriteBatch. #1

Merged
merged 1 commit into from Nov 9, 2012

Conversation

Projects
None yet
2 participants

The SpriteBatch now includes a view-matrix, which is present as

  • a "uniform mat4 viewMatrix" in the Default shader
  • a "protected Matrix4f viewMatrix" in the SpriteBatch class

SpriteBatch has now the method "updateView()", which creates a FloatBuffer out of the Matrix4f viewMatrix, and then uniform with this buffer.

The VertexArrayExample was now changed too, and includes a rotation of the whole view now. That is done by translating into the rotation point, rotating and then translating back. Finally batch.updateView() is called.

Everything is documented with commentars, I hope you accept this Pull Request soon ;)

@matheus23 matheus23 Added the view matrix to the SpriteBatch.
Added view matrix testing code for the VertexArrayExample.
13d2b09

@mattdesl mattdesl added a commit that referenced this pull request Nov 9, 2012

@mattdesl mattdesl Merge pull request #1 from matheus23/master
Added the view-matrix component in the SpriteBatch.
3261e40

@mattdesl mattdesl merged commit 3261e40 into mattdesl:master Nov 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment