Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions jme3-core/src/main/java/com/jme3/effect/ParticleEmitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,13 @@ private Particle emitParticle(Vector3f min, Vector3f max) {
* which are currently inactive will be spawned immediately.
*/
public void emitAllParticles() {
emitParticles(particles.length);
}

/**
* Instantly emits available particles, up to num.
*/
public void emitParticles(int num) {
// Force world transform to update
this.getWorldTransform();

Expand All @@ -888,14 +895,16 @@ public void emitAllParticles() {
max.set(Vector3f.NEGATIVE_INFINITY);
}

while (emitParticle(min, max) != null);
for(int i=0;i<num;i++) {
if( emitParticle(min, max) == null ) break;
}

bbox.setMinMax(min, max);
this.setBoundRefresh();

vars.release();
}

/**
* Instantly kills all active particles, after this method is called, all
* particles will be dead and no longer visible.
Expand Down