Featurerequest ;)

Started by Uija, November 27, 2005, 11:44:25 PM

Previous topic - Next topic

Uija

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.

EgonOlsen

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.

Uija

\o/

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