本文整理汇总了C++中MemoryOutputStream::getSize方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryOutputStream::getSize方法的具体用法?C++ MemoryOutputStream::getSize怎么用?C++ MemoryOutputStream::getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryOutputStream
的用法示例。
在下文中一共展示了MemoryOutputStream::getSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createConvexMesh
PxConvexMesh* createConvexMesh( const std::vector<PxVec3>& verts, PxConvexFlags flags )
{
PxConvexMeshDesc convexDesc;
convexDesc.points.count = verts.size();
convexDesc.points.stride = sizeof(PxVec3);
convexDesc.points.data = &(verts[0]);
convexDesc.flags = flags;
MemoryOutputStream writeBuffer;
if ( !SDK_COOK->cookConvexMesh(convexDesc, writeBuffer) ) return NULL;
MemoryInputData readBuffer( writeBuffer.getData(), writeBuffer.getSize() );
return SDK_OBJ->createConvexMesh( readBuffer );
}
示例2: createConvexMesh
PxConvexMesh* PxToolkit::createConvexMesh(PxPhysics& physics, PxCooking& cooking, const PxVec3* verts, PxU32 vertCount, PxConvexFlags flags)
{
PxConvexMeshDesc convexDesc;
convexDesc.points.count = vertCount;
convexDesc.points.stride = sizeof(PxVec3);
convexDesc.points.data = verts;
convexDesc.flags = flags;
MemoryOutputStream buf;
if(!cooking.cookConvexMesh(convexDesc, buf))
return NULL;
PxToolkit::MemoryInputData input(buf.getData(), buf.getSize());
return physics.createConvexMesh(input);
}
示例3: createTriangleMesh
PxTriangleMesh* createTriangleMesh( const std::vector<PxVec3>& verts, const std::vector<PxU32>& indices )
{
PxTriangleMeshDesc meshDesc;
meshDesc.points.count = verts.size();
meshDesc.points.stride = sizeof(PxVec3);
meshDesc.points.data = &(verts[0]);
meshDesc.triangles.count = indices.size() / 3;
meshDesc.triangles.stride = 3 * sizeof(PxU32);
meshDesc.triangles.data = &(indices[0]);
MemoryOutputStream writeBuffer;
if ( !SDK_COOK->cookTriangleMesh(meshDesc, writeBuffer) ) return NULL;
MemoryInputData readBuffer( writeBuffer.getData(), writeBuffer.getSize() );
return SDK_OBJ->createTriangleMesh( readBuffer );
}
示例4: createClothFabric
PxClothFabric* createClothFabric( const std::vector<PxVec3>& verts, const std::vector<PxU32>& indices,
const osg::Vec3& gravity )
{
PxClothMeshDesc meshDesc;
meshDesc.points.count = verts.size();
meshDesc.points.stride = sizeof(PxVec3);
meshDesc.points.data = &(verts[0]);
meshDesc.triangles.count = indices.size() / 3;
meshDesc.triangles.stride = 3 * sizeof(PxU32);
meshDesc.triangles.data = &(indices[0]);
PxVec3 g( gravity[0], gravity[1], gravity[2] );
#if USE_PHYSX_33
return PxClothFabricCreate( *SDK_OBJ, meshDesc, g );
#else
MemoryOutputStream writeBuffer;
if ( !SDK_COOK->cookClothFabric(meshDesc, g, writeBuffer) ) return NULL;
MemoryInputData readData( writeBuffer.getData(), writeBuffer.getSize() );
return SDK_OBJ->createClothFabric(readData);
#endif
}