Best way to remove objects safely / building walls

Started by Minigame, May 12, 2014, 04:11:03 AM

Previous topic - Next topic

Minigame

What is the best way to remove a specific object (or list of objects) from a jpct world, safely and efficiently? I am rendering a multi player scene but having issues with removing only some models upon logout.. (ex: static props will not need removed)

..and another question.. How can I create a proper 2 sided wall? I've been using rotated planes with wooden textures to create buildings using code. The walls only render when looked at from a certain angle with the camera.

EgonOlsen

You can simply remove them from the world. This will leave the compiled version left behind in the gpu ram though, which will be cleared only if the gc removes the unreferenced Object3D instance to which it belongs. It might be a better approach to use a kind of pool for these objects and let them all reference the same compiled data on the gpu (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#shareCompiledData(com.threed.jpct.Object3D)).

About the wall...i'm not sure if i get the question. The wall is supposed to have no real depth like a paper wall?