-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
241 additions
and
56 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
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,39 @@ | ||
/* | ||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license | ||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template | ||
*/ | ||
package codex.vfx.mesh; | ||
|
||
import com.jme3.math.Vector3f; | ||
import com.jme3.scene.Mesh; | ||
import com.jme3.scene.VertexBuffer.Type; | ||
import com.jme3.util.BufferUtils; | ||
|
||
/** | ||
* | ||
* @author codex | ||
*/ | ||
public class Quad extends Mesh { | ||
|
||
private static final float[] uvs = {1, 1, 1, 0, 0, 0, 0, 1}; | ||
private static final int[] index = {0, 2, 1, 0, 3, 2}; | ||
|
||
public Quad(Vector3f normal, Vector3f up, float width, float height, float originX, float originY) { | ||
Vector3f across = normal.cross(up); | ||
Vector3f climb = normal.cross(across); | ||
Vector3f[] verts = { | ||
across.mult(-width*originX).addLocal(climb.mult(-height*originY)), | ||
across.mult(-width*originX).addLocal(climb.mult(height*originY)), | ||
across.mult(width*originX).addLocal(climb.mult(height*originY)), | ||
across.mult(width*originX).addLocal(climb.mult(-height*originY)), | ||
}; | ||
Vector3f[] normals = {normal, normal, normal, normal}; | ||
setBuffer(Type.Position, 3, BufferUtils.createFloatBuffer(verts)); | ||
setBuffer(Type.Normal, 3, BufferUtils.createFloatBuffer(normals)); | ||
setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(uvs)); | ||
setBuffer(Type.Index, 3, BufferUtils.createIntBuffer(index)); | ||
updateCounts(); | ||
updateBound(); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license | ||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template | ||
*/ | ||
package codex.vfx.particles.drivers; | ||
|
||
import codex.vfx.particles.Particle; | ||
import codex.vfx.particles.ParticleGroup; | ||
|
||
/** | ||
* | ||
* @author codex | ||
* @param <T> | ||
*/ | ||
public abstract class BehaviorDriver <T extends Particle> implements ParticleDriver<T> { | ||
|
||
@Override | ||
public void updateGroup(ParticleGroup<T> group, float tpf) {} | ||
@Override | ||
public void particleAdded(ParticleGroup<T> group, T particle) {} | ||
@Override | ||
public void groupReset(ParticleGroup<T> group) {} | ||
|
||
} |
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
Oops, something went wrong.