Home Forums Programming Saving a Physics World / Scene?

  • This topic has 2 replies, 2 voices, and was last updated 16 years ago by Anonymous.
Viewing 2 reply threads
  • Author
    Posts
    • #6678
      Anonymous
      Inactive

      Hi all,

      Trying to do the following:

      1. Create a physics world.
      2. Create a physics scene within that world.
      3. Populate the scene with actors.
      4. At this point save the state of the physics scene out to disk, or temp variable.
      5. Run the application.
      6. Player falls off track, reset physics scene, re-spawn player.

      Any discussion, on both a high level (general tips) or low level (Ageia 2.7.2 specific) welcome.

      Cheers.
      B.

    • #40713
      Anonymous
      Inactive

      Just a follow-up post.

      I know PhysX has methods like:

      [code:1:a6aaa59792]
      NXU::NxuPhysicsCollection *c = NXU::extractCollectionScene(gScenes[gCurrentScene]);
      [/code:1:a6aaa59792]

      to extract the scene data to a physics collection, and then use something like:

      [code:1:a6aaa59792]
      NXU::instantiateCollection( c, *gPhysicsSDK, 0, 0, &gUserNotify );
      NXU::releaseCollection(c);
      [/code:1:a6aaa59792]

      to take that cached scene from disk, (collada, or nxstream).

      I just wanted to ask would there be much of a performance hit in saving this collection in system memory as opposed to writing out to NxStream or equivalent. I suppose this would be dependent on the number of actors in the physics scene, (which I will profile).

      Any input welcome…

      B.

    • #40775
      Anonymous
      Inactive

      I just wanted to ask would there be much of a performance hit in saving this collection in system memory as opposed to writing out to NxStream or equivalent. I suppose this would be dependent on the number of actors in the physics scene, (which I will profile).
      [/quote:540bb38b1e]

      I’ve no experience of working with Ageia directly, but one thing you’ll have to bear in mind potentially is determinism. To my knowledge Ageia is not determinisitic, which means that serialisation followed by deserialisation is not guaranteed to give you the same initial physics state. The differences will be very small, but depending on your scene could be noticeable.

      Steve

Viewing 2 reply threads
  • The forum ‘Programming’ is closed to new topics and replies.