-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic physics updating is completed; Only draws black squares for now…
…, but animation is happening in a Transparent OpenGL layer
- Loading branch information
1 parent
3c82525
commit f69787b
Showing
15 changed files
with
405 additions
and
73 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,6 @@ buildscript { | |
allprojects { | ||
repositories { | ||
jcenter() | ||
mavenCentral(); | ||
} | ||
} |
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
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
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
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
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
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
96 changes: 96 additions & 0 deletions
96
dust/src/main/java/com/billylindeman/dust/layer/GLParticleLayer.java
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
25 changes: 0 additions & 25 deletions
25
dust/src/main/java/com/billylindeman/dust/layer/ParticleLayer.java
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
dust/src/main/java/com/billylindeman/dust/layer/Rectangle.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.billylindeman.dust.layer; | ||
|
||
import java.nio.ByteBuffer; | ||
import java.nio.ByteOrder; | ||
import java.nio.FloatBuffer; | ||
import java.nio.ShortBuffer; | ||
|
||
import javax.microedition.khronos.opengles.GL10; | ||
|
||
public class Rectangle { | ||
|
||
private float vertices[]={ | ||
-1.0f, 1.0f, 0.0f, | ||
-1.0f,-1.0f,0.0f, | ||
1.0f,-1.0f,0.0f, | ||
1.0f,1.0f,0.0f | ||
}; | ||
|
||
|
||
private short[] indices = {0,1,2,0,2,3}; | ||
|
||
private FloatBuffer vertexBuffer; | ||
private ShortBuffer indexBuffer; | ||
|
||
public Rectangle(){ | ||
ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4); | ||
vbb.order(ByteOrder.nativeOrder()); | ||
vertexBuffer = vbb.asFloatBuffer(); | ||
vertexBuffer.put(vertices); | ||
vertexBuffer.position(0); | ||
|
||
ByteBuffer ibb = ByteBuffer.allocateDirect(indices.length * 2); | ||
ibb.order(ByteOrder.nativeOrder()); | ||
indexBuffer = ibb.asShortBuffer(); | ||
indexBuffer.put(indices); | ||
indexBuffer.position(0); | ||
} | ||
|
||
public void draw(GL10 gl){ | ||
gl.glFrontFace(GL10.GL_CCW); | ||
gl.glEnable(GL10.GL_CULL_FACE); | ||
gl.glCullFace(GL10.GL_BACK); | ||
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); | ||
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); | ||
gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_SHORT, indexBuffer); | ||
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); | ||
gl.glDisable(GL10.GL_CULL_FACE); | ||
} | ||
|
||
} |
Oops, something went wrong.