In an applet I am working on, I got the following messages, which I haven't seen before:
Additional visibility list (2) created with size: 10000
Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
at com.threed.jpct.World.renderScene(Unknown Source)
at C3.JupiterDefense.paint(JupiterDefense.java:166)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
The applet is a target shooter which generates a lot of bullets, each having two Object3Ds (a box and a billboarded quad), so I am thinking that perhaps the problem is that I am not disposing of all these Object3Ds properly. When I am finished with each bullet, I am running the following method:
public void remove()
{
world.removeObject( object3D );
if( childrenObjects != null )
{
for( int i = 0; i < childrenObjects.length; i++ )
{
world.removeObject( childrenObjects[i] );
}
}
}
Is there something else I need to be doing in addition to calling removeObject()?
At this point, I don't really know if it is related to too many Object3Ds or what. I will try and replicate a simple test case if possible - the project is quite large atm. I thought in the mean time, someone might recognize that message (or why might the message "Additional visibility list (2) created with size: 10000" be generated?)
--EDIT--
Oh, I forgot to mention, I have the following line in the applet's init() method, which is where the number "10000" is coming from:
Config.maxPolysVisible = 10000;
I suppose a posibility is that the applet is running out of memory, but in that case I would expect to receive some kind of "out of memory" message instead. I'll try and run this program as an application and see if the problem still exists.