Adding Rigidbody from COM Thread Throws Error

Hello,
I am trying to add a Rigidbody Control from my server com thread. It is throwing the following:

[java]
Oct 09, 2014 6:54:30 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,6,main]
java.lang.NullPointerException
at com.bulletphysics.collision.broadphase.DbvtBroadphase.setAabb(DbvtBroadphase.java:203)
at com.bulletphysics.collision.dispatch.CollisionWorld.updateSingleAabb(CollisionWorld.java:222)
at com.bulletphysics.collision.dispatch.CollisionWorld.updateAabbs(CollisionWorld.java:247)
at com.bulletphysics.collision.dispatch.CollisionWorld.performDiscreteCollisionDetection(CollisionWorld.java:135)
at com.bulletphysics.dynamics.DiscreteDynamicsWorld.internalSingleStepSimulation(DiscreteDynamicsWorld.java:378)
at com.bulletphysics.dynamics.DiscreteDynamicsWorld.stepSimulation(DiscreteDynamicsWorld.java:339)
at com.jme3.bullet.PhysicsSpace.update(PhysicsSpace.java:330)
at com.jme3.bullet.PhysicsSpace.update(PhysicsSpace.java:317)
at com.jme3.bullet.BulletAppState.render(BulletAppState.java:257)
at com.jme3.app.state.AppStateManager.render(AppStateManager.java:300)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:251)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:745)
[/java]

I am not sure why, any ideas?

Thanks,
Trevor

If you are adding a control (from another thread) to a spatial managed by the render loop then you will have nothing but trouble.

1 Like