Fixed an issue where ParticleEmitter had NaN bounds during the first update when added to the scene graph during the update loop
This commit is contained in:
parent
390d35180b
commit
74858976eb
@ -1101,9 +1101,12 @@ public class ParticleEmitter extends Geometry {
|
|||||||
|
|
||||||
lastPos.set(getWorldTranslation());
|
lastPos.set(getWorldTranslation());
|
||||||
|
|
||||||
BoundingBox bbox = (BoundingBox) this.getMesh().getBound();
|
//This check avoids a NaN bounds when all the particles are dead during the first update.
|
||||||
bbox.setMinMax(min, max);
|
if (!min.equals(Vector3f.POSITIVE_INFINITY) && !max.equals(Vector3f.NEGATIVE_INFINITY)) {
|
||||||
this.setBoundRefresh();
|
BoundingBox bbox = (BoundingBox) this.getMesh().getBound();
|
||||||
|
bbox.setMinMax(min, max);
|
||||||
|
this.setBoundRefresh();
|
||||||
|
}
|
||||||
|
|
||||||
vars.release();
|
vars.release();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user