transformVertices null pointer

Started by dectar, March 13, 2011, 02:41:37 AM

Previous topic - Next topic

dectar

Hi, I'm currently getting a seemingly random intermittent null pointer exception at com.threed.jpct.Object3D.transformVertices(Object3D.java:6254) when Im attempting to render a scene. I can do the same thing a few times and this occurs sometimes but not most of the time. Have you any idea what the cause of this is or why the error seems to be random?

Thanks

EgonOlsen

#1
As stated a dozen times, jPCT is NOT thread safe. You are most likely fiddling around with objects or the world in another thread than the rendering thread (like in some listener method). Don't do this. Make sure that manipulation of jPCT related objects happen in the same thread as the rendering or synchronize both.

dectar

ah, yes I have been making small changes to the world in the actual android UI thread so this must be the issue as you stated. I will fix later. thanks for your help.

EgonOlsen

I'll add some code to give a warning in such cases as it's a common mistake.

dectar

sorry for not getting back on this sooner, have been pretty busy. I stopped making any changes to my world from the UI thread and now all works perfectly. Thanks again. I will add my game to project page sometime in next week or so.