Assertion failure in Intersection.intersect()

In 3.1 with assertions enabled, com.jme3.bounding.Intersection.intersect() fails, shortly after I add an emitter to the scene.

The meshBound of the emitter’s mesh gets set to BoundingBox [Center: (NaN, NaN, NaN) xExtent: NaN yExtent: NaN zExtent: NaN] – I’m not sure how – and the worldBounds soon become similarly corrupted with NaNs, leading to:

INFO: jME3-core version is jMonkeyEngine 3.1-5745
Jan 24, 2017 5:51:53 PM mygame.Main simpleUpdate
INFO: add the emitter
Jan 24, 2017 5:51:53 PM handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
at com.jme3.bounding.Intersection.intersect(
at com.jme3.light.PointLight.intersectsBox(
at com.jme3.light.DefaultLightFilter.filterLights(
at com.jme3.renderer.RenderManager.renderGeometry(
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(
at com.jme3.renderer.queue.RenderQueue.renderQueue(
at com.jme3.renderer.RenderManager.renderViewPortQueues(
at com.jme3.renderer.RenderManager.flushQueue(
at com.jme3.renderer.RenderManager.renderViewPort(
at com.jme3.renderer.RenderManager.render(
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(

Any assistance with debugging this would be appreciated. Here is my test class:

import com.jme3.effect.ParticleEmitter;
import com.jme3.effect.ParticleMesh;
import com.jme3.light.PointLight;
import com.jme3.material.Material;
import com.jme3.system.JmeVersion;
import com.jme3.texture.Texture;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Main extends SimpleApplication {

    final private static Logger logger
            = Logger.getLogger(Main.class.getName());
    static float totalTime = 0f;

    public static void main(String[] arguments) {
        Main application = new Main();

    public void simpleInitApp() {
        logger.log(Level.INFO, "jME3-core version is {0}", JmeVersion.FULL_NAME);
        PointLight light = new PointLight();

    public void simpleUpdate(float timeSinceLastUpdate) {
        totalTime += timeSinceLastUpdate;
        if (totalTime > 1f && totalTime < 4f) {
            logger.log(Level.INFO, "add the emitter");

            ParticleEmitter emitter = createEmitter();

            totalTime = 4f;

    private ParticleEmitter createEmitter() {
         * Create material for particles.
        String texturePath = "Effects/Explosion/flame.png";
        Texture texture = assetManager.loadTexture(texturePath);
        String materialPath = "Common/MatDefs/Misc/Particle.j3md";
        Material material = new Material(assetManager, materialPath);
        material.setTexture("Texture", texture);
         * Create the emitter.
        ParticleMesh.Type meshType = ParticleMesh.Type.Triangle;
        int maxParticleCount = 25;
        ParticleEmitter emitter = new ParticleEmitter("emitter",
                meshType, maxParticleCount);

        return emitter;

I should mention that the test class works in jME 3.0.10 with assertions enabled, so this constitutes a regression.

I’ll look into it tonight

1 Like

I eagerly await your findings.

At first glance it seems that the ParticleEmitter bounds are never updated…

1 Like

Got it

Not sure why it was working before. I d’ont remember when the ParticleEmitterControl was added, but maybe it introduced some change in update order of the emitter…
I guess it didn’t matter much without assertions, because the bounds were fixed the next frame.
Anyway it works now with this safety check.

Thanks for reporting


Thank you for the investigation and the fix!

I’ll test the fix with my full application.

I tested the v3.1 fix in two different games. Looks good!

1 Like