Object's user datas are destroyed when retargeting binary file to another platform.


I put some information in the PxShapes’ user data and serialized the whole PxScene. It worked well on windows but the user datas are overwrited with 0x12345678 when I retarget the serialized file to another platform.

I checked the PhysX’s source code about retargeting and I found that

  1. For convert PxShape::userData, a callback for pointer is set in SnConvX_MetaData.cpp like below at line 72.
  2. entries[nb].cb = &Sn::ConvX::convertPtr;
  3. In the callback, as a pointer without any reference, the value of user data is reset in SnConvX_Output.cpp at line 369 like this.
  4. if(!entry.mName || strcmp(entry.mName, "mName"))

I think maybe it is a miss and user data should not be reset like the “mName” entry.

Thanks for any advise !