Exemple #1
0
void FixedJoint::exportExtraData(PxSerialStream& stream)
{
	if(mData)
	{
		Cm::alignStream(stream, PX_SERIAL_DEFAULT_ALIGN_EXTRA_DATA_WIP);
		stream.storeBuffer(mData, sizeof(FixedJointData));
	}
}
// PX_SERIALIZATION
void InternalTriangleMesh::exportExtraData(PxSerialStream& stream)
{
	mData.mOpcodeModel.exportExtraData(stream);

	//DEFINE_DYNAMIC_ARRAY(InternalTriangleMesh, mData.mVertices, PxField::eVEC3, mData.mNumVertices, Ps::F_SERIALIZE),
	if(mData.mVertices)
	{
		Cm::alignStream(stream, PX_SERIAL_DEFAULT_ALIGN_EXTRA_DATA_WIP);
		stream.storeBuffer(mData.mVertices, mData.mNumVertices * sizeof(PxVec3));
	}

	if(mData.mTriangles)
	{
		const PxU32 triangleSize = mData.m16BitIndices ? sizeof(PxU16) : sizeof(PxU32);
		Cm::alignStream(stream, PX_SERIAL_DEFAULT_ALIGN_EXTRA_DATA_WIP);
		stream.storeBuffer(mData.mTriangles, mData.mNumTriangles * 3 * triangleSize);
	}

	//DEFINE_DYNAMIC_ARRAY(InternalTriangleMesh, mData.mExtraTrigData, PxField::eBYTE, mData.mNumTriangles, Ps::F_SERIALIZE),
	if(mData.mExtraTrigData)
	{
		// PT: it's a bit silly to 16-byte align this array of PxU8.... sigh
		Cm::alignStream(stream, PX_SERIAL_DEFAULT_ALIGN_EXTRA_DATA_WIP);
		stream.storeBuffer(mData.mExtraTrigData, mData.mNumTriangles * sizeof(PxU8));
	}

	//DEFINE_DYNAMIC_ARRAY(InternalTriangleMesh, mMaterialIndices, PxField::eWORD, mData.mNumTriangles, Ps::F_SERIALIZE),
	if(mMaterialIndices)
	{
		Cm::alignStream(stream, PX_SERIAL_DEFAULT_ALIGN_EXTRA_DATA_WIP);
		stream.storeBuffer(mMaterialIndices, mData.mNumTriangles * sizeof(PxU16));
	}

	//DEFINE_DYNAMIC_ARRAY(InternalTriangleMesh, mFaceRemap, PxField::eDWORD, mData.mNumTriangles, Ps::F_SERIALIZE),
	if(mFaceRemap)
	{
		Cm::alignStream(stream, PX_SERIAL_DEFAULT_ALIGN_EXTRA_DATA_WIP);
		stream.storeBuffer(mFaceRemap, mData.mNumTriangles * sizeof(PxU32));
	}
}
void D6Joint::exportExtraData(PxSerialStream& stream)
{
	if(mData)
		stream.storeBuffer(mData, sizeof(D6JointData));
}