Author Topic: Featurerequest ;)  (Read 3611 times)

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Featurerequest ;)
« on: November 27, 2005, 11:44:25 pm »
Is there a way to serialize OcTrees?
I currently have a converted heightmap with nearly 32k Triangles. Without an octree this isnt useable, but, construction the octree needs around 1 minute, that I don't want so spend everytime I start a new Map :P
I tested it against a smaller map, with and without octree, it doesn't make a too big difference in memoryuseage. (Small map (3200 triangles) without octree uses 104MB B RAM, Big Map (32k triangles) with octree uses 116 MB ram. I could split the map into several smaller parts and only display those, that I see, but the memoryuseage would be the same I think. So it would be realy cool, to save the OcTree into a file, or better, Build a containerobject, where you can add an Object3D and a OcTree and Serialize them together =)
Dunno if it is doable, but it would save alot of time doing the same thing over and over again.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Featurerequest ;)
« Reply #1 on: November 28, 2005, 08:59:03 am »
Quote from: "Uija"
Is there a way to serialize OcTrees?
Octree implements java.io.Serializable, so you should be able to serialize it using Java's standard serialization methods.

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Featurerequest ;)
« Reply #2 on: November 28, 2005, 09:36:11 am »
\o/

Edit: Works great. Sorry, I looked for a method in OcTree to export or serialize and didn't look up the Javadoc :(