mr_burns
13-04-2008 00:18:57
Hi all,
Is it possible to create my NxScene or (NxWorld) and save that information to disk, or to a temp variable?
What I am trying to achieve is the following:
Load level, create physics scene, start race.
Player falls off track, respawn player, and reset the physics to where it was when level initially started.
Any input welcome.
Mr B.
mr_burns
13-04-2008 00:52:27
Just a follow-up post.
I know PhysX has methods like:
NXU::NxuPhysicsCollection *c = NXU::extractCollectionScene(gScenes[gCurrentScene]);
to extract the scene data to a physics collection, and then use something like:
NXU::instantiateCollection( c, *gPhysicsSDK, 0, 0, &gUserNotify );
NXU::releaseCollection(c);
to take that cached scene from disk, (collada, or nxstream).
I just wanted to ask if there was comparable method(s) for this functionality in NxOgre.
Also, would there be much of a performance hit in saving this collection in memory as opposed to writing out to NxStream or equivalent.
B.
mr_burns
13-04-2008 09:23:17
Had a closer look at the latest source, and think I should be able to get what I need from:
exportWorldToFile(NxOgre::Serialiser::BlueprintsFormat f, NxString n)
importWorldFromFile(NxOgre::Serialiser::BlueprintsFormat f, NxString n)
exportWorldToString(NxOgre::Serialiser::BlueprintsFormat f)
importWorldFromString(NxOgre::Serialiser::BlueprintsFormat f, NxString s)
Will just have to do some profiling and evaluate the overhead of disking the physics scene.
betajaen
13-04-2008 11:42:57
I've been working on a serialization library for the last week. I plan to embed it in soon.
But if you use the NxuStream library by hand (which I don't recommend) you will have to write all of the Ogre/NxOgre bindings yourself - which isn't pleasant.
Or you can wait until I've done a proper serialization library for NxOgre that doesn't require NxuStream.