31 #ifndef PX_PHYSICS_COMMON_NX_SERIAL_FRAMEWORK 32 #define PX_PHYSICS_COMMON_NX_SERIAL_FRAMEWORK 53 #define PX_SERIAL_ALIGN 16 56 #define PX_SERIAL_FILE_ALIGN 128 59 #define PX_SERIAL_OBJECT_ID_INVALID 0 65 #define PX_SERIAL_REF_KIND_PTR_TYPE_BIT (1u<<31) 68 #define PX_SERIAL_REF_KIND_PXBASE (0 | PX_SERIAL_REF_KIND_PTR_TYPE_BIT) 71 #define PX_SERIAL_REF_KIND_MATERIAL_IDX (1) 74 #define PX_MAKE_FOURCC(a, b, c, d) ( (a) | ((b)<<8) | ((c)<<16) | ((d)<<24) ) 85 virtual void process(
PxBase&) = 0;
124 virtual void registerReference(
PxBase& base,
PxU32 kind,
size_t reference) = 0;
138 virtual void writeData(
const void* data,
PxU32 size) = 0;
156 virtual void writeName(
const char* name) = 0;
196 virtual PxBase* resolveReference(
PxU32 kind,
size_t reference)
const = 0;
215 PxU32 len = *
reinterpret_cast<PxU32*
>(mExtraDataAddress);
216 mExtraDataAddress +=
sizeof(len);
217 name = len ?
reinterpret_cast<const char*
>(mExtraDataAddress) : NULL;
218 mExtraDataAddress += len;
231 T* data =
reinterpret_cast<T*
>(mExtraDataAddress);
232 mExtraDataAddress +=
sizeof(T)*count;
243 template<
typename T, PxU32 alignment>
246 alignExtraData(alignment);
247 return readExtraData<T>(count);
259 size_t addr =
reinterpret_cast<size_t>(mExtraDataAddress);
260 addr = (addr+alignment-1)&~
size_t(alignment-1);
261 mExtraDataAddress =
reinterpret_cast<PxU8*
>(addr);
269 virtual PxU32 getPhysXVersion()
const = 0;
382 virtual PxRepXSerializer* getRepXSerializer(
const char* typeName)
const = 0;
395 virtual void release() = 0;
Definition: GuContactBuffer.h:37
Class serving as a registry for XML (RepX) and binary serializable types.
Definition: PxSerialFramework.h:297
PX_INLINE T * readExtraData(PxU32 count=1)
Function to read extra data during deserialization optionally aligning the extra data stream before r...
Definition: PxSerialFramework.h:244
PX_INLINE void readName(const char *&name)
Helper function to read a name from the extra data during deserialization.
Definition: PxSerialFramework.h:213
#define PX_SERIAL_REF_KIND_PXBASE
Reference kind value for PxBase objects.
Definition: PxSerialFramework.h:68
PxU16 PxType
Definition: PxSerialFramework.h:45
PX_INLINE void alignExtraData(PxU32 alignment=PX_SERIAL_ALIGN)
Function to align the extra data stream to a power of 2 alignment.
Definition: PxSerialFramework.h:257
Output stream class for I/O.
Definition: PxIO.h:114
uint64_t PxU64
Definition: PxSimpleTypes.h:69
#define PX_SERIAL_ALIGN
Default serialization alignment.
Definition: PxSerialFramework.h:53
Serialization interface class.
Definition: PxSerializer.h:61
Serializer interface for RepX (Xml) serialization.
Definition: PxRepXSerializer.h:66
PxU64 PxSerialObjectId
ID type for PxBase objects in a PxCollection.
Definition: PxSerialFramework.h:62
virtual ~PxProcessPxBaseCallback()
Definition: PxSerialFramework.h:84
PxSerializationContext()
Definition: PxSerialFramework.h:160
PxDeserializationContext()
Definition: PxSerialFramework.h:273
uint8_t PxU8
Definition: PxSimpleTypes.h:75
PxU8 * mExtraDataAddress
Definition: PxSerialFramework.h:276
virtual ~PxDeserializationContext()
Definition: PxSerialFramework.h:274
void translatePxBase(T *&base)
Helper function to update PxBase pointer on deserialization.
Definition: PxSerialFramework.h:204
Binary deserialization context class.
Definition: PxSerialFramework.h:174
Collection class for serialization.
Definition: PxCollection.h:105
virtual ~PxSerializationRegistry()
Definition: PxSerialFramework.h:398
Abstract singleton factory class used for instancing objects in the Physics SDK.
Definition: PxPhysics.h:71
uint16_t PxU16
Definition: PxSimpleTypes.h:73
uint32_t PxU32
Definition: Px.h:48
PX_INLINE T * readExtraData(PxU32 count=1)
Function to read extra data during deserialization.
Definition: PxSerialFramework.h:229
Base class for objects that can be members of a PxCollection.
Definition: PxBase.h:73
virtual ~PxSerializationContext()
Definition: PxSerialFramework.h:161
Binary serialization context class.
Definition: PxSerialFramework.h:99
#define PX_INLINE
Definition: PxPreprocessor.h:349
Callback class used to process PxBase objects.
Definition: PxSerialFramework.h:81
void(* PxBinaryMetaDataCallback)(PxOutputStream &stream)
Callback type for exporting binary meta data for a serializable type.
Definition: PxSerialFramework.h:285