Author Topic: Best way to remove objects safely / building walls  (Read 712 times)

Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
Best way to remove objects safely / building walls
« on: May 12, 2014, 04:11:03 am »
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.
« Last Edit: May 12, 2014, 07:02:34 am by corey »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11775
    • View Profile
    • http://www.jpct.net
Re: Best way to remove objects safely / building walls
« Reply #1 on: May 12, 2014, 08:33:50 am »
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?