www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: John Tribe on March 01, 2013, 12:05:46 am

Title: serialize related questions
Post by: John Tribe on March 01, 2013, 12:05:46 am
1. is serialize() save transformedCenterData and size information?
2. is there a way to force save this data
3. is ID change when deserialize and add to world? If not, what you suggest to make relation with another data .. like game Data?
4. is call compile and build,  clear some information? (e.g. position, rotation)

sorry for the stupidity
Title: Re: serialize related questions
Post by: EgonOlsen on March 01, 2013, 09:52:06 pm
Title: Re: serialize related questions
Post by: John Tribe on March 02, 2013, 08:10:33 am
About 3 :

I have the hero and monster object the all of them have they own object3d. and if i save the object3d[] array of all of them(as one array) and hero objects and monster objects i save as gameObjects[] array, then when i loading i need to create mapping with the heros , monster objects and objects3d ,first i thought that id is unique, but isn't. Do you have any ideas? I can use name field for this, but i would like to leave this for display purpose. 

Thanks for help
Title: Re: serialize related questions
Post by: EgonOlsen on March 02, 2013, 08:32:22 am
Even if the id would have been stored in the file, you can't ensure that it will be unique after loading because you might have saved multiple objects with the same id.
Title: Re: serialize related questions
Post by: John Tribe on March 02, 2013, 09:20:38 pm
after loading serialized object, I am trying to copy object and i getting exception in my face. Someone could tell me why?

Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 3518
   at com.threed.jpct.Object3D.copy(Unknown Source)
   at com.threed.jpct.Object3D.<init>(Unknown Source)
   at com.threed.jpct.Object3D.cloneObject(Unknown Source)
Title: Re: serialize related questions
Post by: EgonOlsen on March 02, 2013, 11:15:48 pm
Which version of jPCT are you using? Looks like an older one to me!?
Title: Re: serialize related questions
Post by: John Tribe on March 03, 2013, 12:37:30 am
Manifest-Version: 1.0
Created-By: EgonOlsen
Version: 1.15beta3

well i uploaded the newest version: 2012-12-18 -  still the same. 

Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 17426
   at com.threed.jpct.Object3D.copy(Object3D.java:904)
   at com.threed.jpct.Object3D.<init>(Object3D.java:776)
   at com.threed.jpct.Object3D.cloneObject(Object3D.java:3518)

there are lines now :D
Title: Re: serialize related questions
Post by: EgonOlsen on March 03, 2013, 09:08:17 am
How do you store your objects? Make sure that you aren't storing them in reduced mode.
Title: Re: serialize related questions
Post by: John Tribe on March 03, 2013, 02:04:10 pm
yeah that was the problem. thx!