当前位置: 首页>>代码示例>>C++>>正文


C++ MemoryOutputStream::getSize方法代码示例

本文整理汇总了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 );
}
开发者ID:caomw,项目名称:osgPhysX,代码行数:14,代码来源:PhysicsUtil.cpp

示例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);
}
开发者ID:Borzen,项目名称:SrProject,代码行数:15,代码来源:PxTkStream.cpp

示例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 );
}
开发者ID:caomw,项目名称:osgPhysX,代码行数:16,代码来源:PhysicsUtil.cpp

示例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
}
开发者ID:caomw,项目名称:osgPhysX,代码行数:22,代码来源:PhysicsUtil.cpp


注:本文中的MemoryOutputStream::getSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。