www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Uija on November 27, 2005, 11:44:25 pm

Title: Featurerequest ;)
Post by: Uija 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.
Title: Re: Featurerequest ;)
Post by: EgonOlsen 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.
Title: Featurerequest ;)
Post by: Uija 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 :(