Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - LemonLake

Pages: [1]
1
Support / world.removeObject(Object3D) crash
« on: October 04, 2013, 08:24:22 pm »
I have a bunch of tiles in my world (a 16x16 array for now, but only a circle of them are created) and some have houses on them. In the array is a Tile object, which holds the tile information such as the height, the tile model (a hexagon) and it's child if it has one. The tile position is stored in the model's name so I can access it through picking. In a touch event, I am removing the house of the tile if it has one, using this code:
Code: [Select]
    String name = ((Object3D) res[1]).getName();
    int foundTileX = Integer.parseInt(name.replace("Tile_", "").split(";")[0]);
    int foundTileY = Integer.parseInt(name.replace("Tile_", "").split(";")[1]);
    Tile foundTile = map.tiles[foundTileX][foundTileY];
    if(foundTile.child!=null){
    world.removeObject(foundTile.child);
    foundTile.child=null;
    }
However, as soon as a house is removed, the game crashes with this error:

I believe it happens because the touchEvent happens after the world stuff and before the rendering.
How can I solve this? Thanks

2
Support / Disable logging
« on: October 03, 2013, 08:49:32 pm »
I have over a thousand objects in my scene, and JPCT logs about ten lines for each one upon creation. Is there any way to disable this? Thanks

Pages: [1]