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
- For convert PxShape::userData, a callback for pointer is set in SnConvX_MetaData.cpp like below at line 72.
- 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.
entries[nb].cb = &Sn::ConvX::convertPtr;
if(!entry.mName || strcmp(entry.mName, "mName")) value=0x12345678;
I think maybe it is a miss and user data should not be reset like the “mName” entry.
Thanks for any advise !