j3o signature?

Hi folks, I was wondering if there is a ‘clean’ way to obtain some type of signature (say sha-1/md5) of loaded j3o file?



In essence, my game startup walks the scene graph, creating a ‘collision’ graph, which takes a very long time on android, Ideally I would like to generate this on the fly when the scene is loaded, and store the results. When game is loaded up next time…assuming the j3o file has not changed I would just load up the collection graph, rather then rebuilt it from the scene.



is this signature already built in somewhere?..if not how can determine the actual ‘file path’ of j3o file at runtime to calculate the signature?

They may not exist on disk in physical form that is readable but they can generally be accessed as InputStreams. I know for regular assets the standard Java class resource stuff works.



Still, you’d be better off putting a version in the root of the j3o as UserData on the root node. Then you could just check this against the last known version. It is more reliable than a signature and much faster/convenient.

2 Likes

yeah, that sounds like that should work. :slight_smile: