Serialization not working.... I serialize using JPCT 1.15 beta3

Started by zoalord12, November 19, 2015, 02:40:03 AM

Previous topic - Next topic

zoalord12

Hi

Im serializing stuff on windows and reading it on Android

I serialized in  JPCT 1.15Beta3
I deserialzie in JPCT-AE 1.0 , there is a version mismatch and it wont deserialize Object3D

it throws the exception
java.lang.RuntimeException: [ 1447896135952 ] - ERROR: Can't deserialize object: [ 1447896135950 ] - ERROR: Unsupported version: 2023511133

Please help, i looked for the older version of JPCT but i cant find it anywhere :'(

EgonOlsen

Just upgrade. Why are you using such ancient versions? Early versions didn't write the file version correctly.

BTW: There is no jPCT-AE 1.0. The versioning of -AE follows that of jPCT. And 1.15 didn't even have support for serializing objects. That has been added in 1.21. So something is fishy with your version numbers... ???

zoalord12

yeah u r right.

i updated some jars and fixed another issue, i was compressing the file at one place but not decompressing before loading the object from a serialized version.

works now, thanks.

how do i fit model to screen ?  I looked at some examples online but they didnt help

EgonOlsen

Quote from: zoalord12 on November 19, 2015, 05:38:15 PM
how do i fit model to screen ?  I looked at some examples online but they didnt help
Depends on your needs. I usually do a trial and error approach.

zoalord12

sadness has befallen me now , .......................

Isn't there a fit-to-screen type thing i can use ? in the camera  ?

I noticed i can calcBoundingBox and setBoundingBox on Object3D, but i cant get the one that's calculated ? did i miss something here

if i can get that, i can fit the camera somehow

EgonOlsen

Quote from: zoalord12 on November 19, 2015, 06:41:00 PM
I noticed i can calcBoundingBox and setBoundingBox on Object3D, but i cant get the one that's calculated ? did i miss something here
You can get it from Object3D.getMesh().getBoundingBox(); (http://www.jpct.net/doc/com/threed/jpct/Mesh.html#getBoundingBox()). It's in object space coordinates. If you want them in world space, look here: http://www.jpct.net/wiki/index.php?title=Getting_Worldspace_Bounds

You can transform these coordinates into screen space by using the methods provided by Interact2D. So yes, you can calculated something but there's no magic fit()-method.