14 #ifndef PX_PHYSICS_COMMON_NX_SERIAL_FRAMEWORK
15 #define PX_PHYSICS_COMMON_NX_SERIAL_FRAMEWORK
39 #define PX_SERIAL_ALIGN 16
42 #define PX_SERIAL_FILE_ALIGN 128
45 #define PX_SERIAL_OBJECT_ID_INVALID 0
51 #define PX_SERIAL_REF_KIND_PTR_TYPE_BIT (1u<<31)
54 #define PX_SERIAL_REF_KIND_PXBASE (0 | PX_SERIAL_REF_KIND_PTR_TYPE_BIT)
57 #define PX_SERIAL_REF_KIND_MATERIAL_IDX (1)
60 #define PX_MAKE_FOURCC(a, b, c, d) ( (a) | ((b)<<8) | ((c)<<16) | ((d)<<24) )
71 virtual void process(
PxBase&) = 0;
110 virtual void registerReference(
PxBase& base,
PxU32 kind,
size_t reference) = 0;
124 virtual void writeData(
const void* data,
PxU32 size) = 0;
142 virtual void writeName(
const char* name) = 0;
182 virtual PxBase* resolveReference(
PxU32 kind,
size_t reference)
const = 0;
202 mExtraDataAddress +=
sizeof(len);
203 name = len ? (
const char*)mExtraDataAddress :
NULL;
204 mExtraDataAddress += len;
217 T* data =
reinterpret_cast<T*
>(mExtraDataAddress);
218 mExtraDataAddress +=
sizeof(T)*count;
229 template<
typename T, PxU32 alignment>
232 alignExtraData(alignment);
233 return readExtraData<T>(count);
245 size_t addr =
reinterpret_cast<size_t>(mExtraDataAddress);
246 addr = (addr+alignment-1)&~
size_t(alignment-1);
247 mExtraDataAddress =
reinterpret_cast<PxU8*
>(addr);
255 virtual PxU32 getPhysXVersion()
const = 0;
368 virtual PxRepXSerializer* getRepXSerializer(
const char* typeName)
const = 0;
381 virtual void release() = 0;