0

I'm trying create a PhysX actor w/ a custom mesh., following the official doc:

static const PxVec3 convexVerts[] = {PxVec3(0,1,0),PxVec3(1,0,0),PxVec3(-1,0,0),PxVec3(0,0,1),PxVec3(0,0,-1)};


PxConvexMeshDesc convexDesc;
convexDesc.points.count     = 5;
convexDesc.points.stride    = sizeof(PxVec3);
convexDesc.points.data      = convexVerts;
convexDesc.flags            = PxConvexFlag::eCOMPUTE_CONVEX;
convexDesc.vertexLimit      = 256;

PxToolkit::MemoryOutputStream buf;
if(!cooking.cookConvexMesh(convexDesc, buf))
    return NULL;
PxToolkit::MemoryInputData input(buf.getData(), buf.getSize());
PxConvexMesh* convexMesh = thePhysics->createConvexMesh(input);
PxShape* aConvexShape = aConvexActor->createShape(PxConvexMeshGeometry(convexMesh), aMaterial);

Taken from the official docs.

But when I try to compile:

error C2039: 'MemoryOutputStream' is not a member of PxToolkit.

I've included the PxToolkit.lib file I manually built using VS 2013,as well as the headers. And indeed MOS is not in the PxTkStream.cpp.

Vinz243
  • 9,654
  • 10
  • 42
  • 86
  • Did you include the header that declares `PxToolkit::MemoryOutputStream`? – Biffen Dec 16 '14 at 15:46
  • Well, there is no such header :( The PxTkStreams hdr/src is here https://gist.github.com/vinz243/294308f6e891118f06bb – Vinz243 Dec 16 '14 at 15:50
  • If no header declares that type, and you don't declare it, how do you expect the compiler to know what it is? – Biffen Dec 16 '14 at 15:53
  • Well, that's the weird problem. Is the tutorial out of date? What should I do? – Vinz243 Dec 16 '14 at 15:54
  • Search for `MemoryOutputStream` in all the headers provided by the library. – Biffen Dec 16 '14 at 15:55
  • Searched with sublime text, nothing seemed to match. Here are the result if you wanna take a look https://gist.github.com/vinz243/7a7eab187ea7596218a3 – Vinz243 Dec 16 '14 at 16:08

1 Answers1

0

a bit late but you should just use PxDefaultMemoryInputData and PxDefaultMemoryOutputStream according to the docs

tomer zeitune
  • 1,080
  • 1
  • 12
  • 14