www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: dectar on March 13, 2011, 02:41:37 am

Title: transformVertices null pointer
Post by: dectar on March 13, 2011, 02:41:37 am
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
Title: Re: transformVertices null pointer
Post by: EgonOlsen on March 13, 2011, 09:34:33 am
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.
Title: Re: transformVertices null pointer
Post by: dectar on March 14, 2011, 10:37:41 am
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.
Title: Re: transformVertices null pointer
Post by: EgonOlsen on March 14, 2011, 08:22:17 pm
I'll add some code to give a warning in such cases as it's a common mistake.
Title: Re: transformVertices null pointer
Post by: dectar on March 25, 2011, 01:26:50 pm
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.