   Mesh access without DirectX
  I am setting up my server and I do not use DirectX on it (performance issues),I access the mesh for use with PhysX as follows, I wonder whether we can do this without using DirectX:///////////////////////////////////////////////////////// Generate(cooking) a convex physics object from a DX mesh///////////////////////////////////////////////////////void PhysicsLevel::cookingMesh(ID3DXMesh* Mesh, NxVec3 pos){typedef struct {D3DXVECTOR3 VertexPos;D3DXVECTOR3 Normal;D3DXVECTOR2 TexCoord;} Mesh_FVF;//Used to copy indicestypedef struct {short IBNumber[3];} IndexBufferStruct;int NumVerticies = Mesh->GetNumVertices();int NumTriangles = Mesh->GetNumFaces();DWORD FVFSize = D3DXGetFVFVertexSize(Mesh->GetFVF());//Create pointer for verticesNxVec3* verts = new NxVec3[NumVerticies];char *DXMeshPtr;Mesh->LockVertexBuffer(D3DLOCK_READONLY, (void**)&DXMeshPtr);for(int i = 0; i < NumVerticies; i++){Mesh_FVF *DXMeshFVF = (Mesh_FVF*)DXMeshPtr;verts = NxVec3(DXMeshFVF->VertexPos.x, DXMeshFVF->VertexPos.y, DXMeshFVF->VertexPos.z);DXMeshPtr += FVFSize;}Mesh->UnlockVertexBuffer();//Create pointer for indicesIndexBufferStruct *tris = new IndexBufferStruct[NumTriangles];IndexBufferStruct *DXMeshIBPtr;Mesh->LockIndexBuffer(D3DLOCK_READONLY, (void**)&DXMeshIBPtr);for(int NumInd = 0; NumInd < NumTriangles; NumInd++){tris[NumInd].IBNumber[0] = DXMeshIBPtr[NumInd].IBNumber[0];tris[NumInd].IBNumber[1] = DXMeshIBPtr[NumInd].IBNumber[1];tris[NumInd].IBNumber[2] = DXMeshIBPtr[NumInd].IBNumber[2];}Mesh->UnlockIndexBuffer();// Build physical modelNxTriangleMeshDesc TriMeshDesc;TriMeshDesc.numVertices = NumVerticies;TriMeshDesc.numTriangles = NumTriangles;TriMeshDesc.pointStrideBytes = sizeof(NxVec3);TriMeshDesc.triangleStrideBytes = 3*sizeof(short);TriMeshDesc.points = verts;TriMeshDesc.triangles = tris;TriMeshDesc.flags = NX_MF_16_BIT_INDICES;NxTriangleMeshShapeDesc ShapeDesc;ShapeDesc.group=GROUP_COLLIDABLE_NON_PUSHABLE;if(0){// Cooking from filebool status = NxCookTriangleMesh(TriMeshDesc, UserStream("c:\\tmp.bin", false));ShapeDesc.meshData = m_PhysicsSDK->createTriangleMesh(UserStream("c:\\tmp.bin", true));}else{// Cooking from memoryMemoryWriteBuffer buf;bool status = NxCookTriangleMesh(TriMeshDesc, buf);ShapeDesc.meshData = m_PhysicsSDK->createTriangleMesh(MemoryReadBuffer(buf.data));}NxActorDesc actorDesc;actorDesc.shapes.pushBack(&ShapeDesc);actorDesc.globalPose.t = pos;PhysXLevel = m_Scene->createActor(actorDesc);PhysXLevel->userData = (void*)1;PhysXLevel->raiseBodyFlag(NX_BF_KINEMATIC);delete[] verts;delete[] tris;}