Error occur when enable eSCENE_COLLISION.

Hi everyone.I want to simulate a dress(triangle mesh) collide with a human body. I create dress as PxCloth, and human body as static rigid object. But error occur when I enable eSCENE_COLLISION “m_PxCloth->setClothFlag(PxClothFlag::eSCENE_COLLISION, true);”.

error lies in “m_scene->fetchResults(true);”

Details as follows:

…\foundation\src\PsFoundation.cpp (268) : abort : User allocator returned NULL.
…\PhysXExtensions\src\ExtDefaultErrorCallback.cpp(95) : Assertion failed: e != PxErrorCode::eABORT

Could anyone help me? Thanks a lot.

Just now I find that if eSCENE_COLLISION is enabled, PxDefaultAllocator::platformAlignedAlloc(…) needs to allocate 4292664196 bytes memory, that’s obviously too large.

PS:My program is MFC application, Visual studio 2010. win7 x64.

Hi there, problem solved ! For some reasons, I call PxCloth::removeCollisionTriangle(i),and PxCloth::removeCollisonSphere(i) in my initialization even if there exist no collison triangles or collison sphere. That’s the problem.

I’ve another question: my PxCloth has about 7K vertices, and human body for collision has about 50k vertices. Is it normal that the speed become very very slow( FPS: 0.5 ) ?

PxCloth is designed for clothing simulation on game characters, with emphasis on high performance and stability. That’s why it is using dedicated collision detection system, mostly based on simple spheres and capsules to represent underlaying character skeleton.

eSCENE_COLLISION is sort of “hack”, that copies PhysX scene geometry (or rather approximates it) near the cloth actor into cloth collision system. Using it to detect collision with 75k triangle mesh is not effective.
However, if your clothing is rather tight, you can look into co called “backstop” collisions

Thanks for help Racoon1, but, eh, I want to handle collision automatically in code, not depends on manual tools. Just for another question, with 32 spheres and capsules (PhysX SDK says at most 32 spheres can add to the scene ), is it enough to approximate a human body precisely ? And, how can I generate spheres and capsules for a human body? Thanks a lot.

Depends on your needs and skeleton configuration

As example, this is how full-body collision skeleton is looking in new iClone 6 animation package (they have added PhysX 3 cloth for character simulation recently)

OK, Thank you. Actually, I’m currently working on a project about “virtual fitting”: a garment and a human body, I drape the garment on the body. So I need to do collision detection between cloth and body. In PhysX, cloth is PxCloth, human body could be approximated using spheres and capsules. But I have no idea how to create spheres and capsules from human body(obj file). Is there any software to do that? Could iClone save the results? Again, Thanks a lot.