trying to get cloth to work

seranus

30-11-2009 19:16:22

im kinda of a noobish and trying to get a cloth to display. I got to this point from using search but i cant get anything to display not sure what im doing wrong. When i try to cloth->attachVertexToGlobalPosition i get Access violation reading location, i think something didnt load and im missing it. Rest of the code is tutorial 2.Btw the code runs like this but nothing shows up.

NxOgre::ClothDescription desc;
desc.mMesh = NxOgre::Functions::Mesh::generateFlatCloth(NxOgre::ArchiveResourceIdentifier("memory:"), NxOgre::Vec2(10,10), 1);
if (desc.mMesh == NULL)
return;
desc.mGlobalPose.identity();
desc.mGlobalPose.set(0, 70, 0);
desc.mFlags |= NxOgre::Enums::ClothFlags_DebugVisualisation;
desc.mFlags |= NxOgre::Enums::ClothFlags_Hardware;

NxOgre::Cloth* cloth = mRenderSystem->createCloth(desc, "Examples/DarkMaterial");
if (cloth == NULL)
return;
// cloth->attachVertexToGlobalPosition(0, NxOgre::Vec3(1, 70, 0));
// cloth->attachVertexToGlobalPosition(16, NxOgre::Vec3(4, 10, 0));
// cloth->attachVertexToGlobalPosition(32, NxOgre::Vec3(8, 10, 0));
}